Skip to content

Commit 01bf430

Browse files
Add docs for WSGIDestroyInterpreter directive.
1 parent e80ac37 commit 01bf430

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
======================
2+
WSGIDestroyInterpreter
3+
======================
4+
5+
:Description: Enable/disable cleanup of Python interpreter.
6+
:Syntax: ``WSGIDestroyInterpreter On|Off``
7+
:Default: ``WSGIDestroyInterpreter On``
8+
:Context: server config
9+
10+
The ``WSGIDestroyInterpreter`` directive is used to control whether the Python
11+
interpreter is destroyed when processes are shutdown or restarted. By default
12+
the Python interpreter is destroyed when the process is shutdown or restarted.
13+
14+
This directive was added due to changes in Python 3.9 where the Python cleanup
15+
behaviour was changed such that it would wait on daemon threads to complete.
16+
This could cause cleanup of the Python interpreter to hang in the some cases
17+
where threads were created external to Python, as is the case where Python is
18+
embedded in a C program such as mod_wsgi with Apache.
19+
20+
This problem of hanging when cleanup of the Python interpreter was attempted
21+
was especially noticeable when using mod_wsgi to host Trac.
22+
23+
Note that it is not known whether versions of Python newer than 3.9 still have
24+
this problem or whether further changes were made in Python interpreter cleanup
25+
code.

docs/configuration.rst

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Configuration
1414
configuration-directives/WSGICaseSensitivity
1515
configuration-directives/WSGIChunkedRequest
1616
configuration-directives/WSGIDaemonProcess
17+
configuration-directives/WSGIDestroyInterpreter
1718
configuration-directives/WSGIImportScript
1819
configuration-directives/WSGILazyInitialization
1920
configuration-directives/WSGIPassAuthorization

0 commit comments

Comments
 (0)