From 01bf4303bc5846a9311ef4e8d4cece5f9435a96d Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 11 Sep 2024 14:51:35 +1000 Subject: [PATCH] Add docs for WSGIDestroyInterpreter directive. --- .../WSGIDestroyInterpreter.rst | 25 +++++++++++++++++++ docs/configuration.rst | 1 + 2 files changed, 26 insertions(+) create mode 100644 docs/configuration-directives/WSGIDestroyInterpreter.rst diff --git a/docs/configuration-directives/WSGIDestroyInterpreter.rst b/docs/configuration-directives/WSGIDestroyInterpreter.rst new file mode 100644 index 00000000..da6169e4 --- /dev/null +++ b/docs/configuration-directives/WSGIDestroyInterpreter.rst @@ -0,0 +1,25 @@ +====================== +WSGIDestroyInterpreter +====================== + +:Description: Enable/disable cleanup of Python interpreter. +:Syntax: ``WSGIDestroyInterpreter On|Off`` +:Default: ``WSGIDestroyInterpreter On`` +:Context: server config + +The ``WSGIDestroyInterpreter`` directive is used to control whether the Python +interpreter is destroyed when processes are shutdown or restarted. By default +the Python interpreter is destroyed when the process is shutdown or restarted. + +This directive was added due to changes in Python 3.9 where the Python cleanup +behaviour was changed such that it would wait on daemon threads to complete. +This could cause cleanup of the Python interpreter to hang in the some cases +where threads were created external to Python, as is the case where Python is +embedded in a C program such as mod_wsgi with Apache. + +This problem of hanging when cleanup of the Python interpreter was attempted +was especially noticeable when using mod_wsgi to host Trac. + +Note that it is not known whether versions of Python newer than 3.9 still have +this problem or whether further changes were made in Python interpreter cleanup +code. diff --git a/docs/configuration.rst b/docs/configuration.rst index 8c989f31..b296210c 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -14,6 +14,7 @@ Configuration configuration-directives/WSGICaseSensitivity configuration-directives/WSGIChunkedRequest configuration-directives/WSGIDaemonProcess + configuration-directives/WSGIDestroyInterpreter configuration-directives/WSGIImportScript configuration-directives/WSGILazyInitialization configuration-directives/WSGIPassAuthorization