Open jdoc-sag opened 1 month ago
(It appears it affects Python 3.12 for Fedora, so I also put 3.11 and 3.12 labels)
cc @vstinner as the author of the fix (also I'm not sure that it only affects subinterpreters or if its a wider bug)
If you're using mod_wsgi, you can use "WSGIDestroyInterpreter Off" configuration option to work around this issue.
Fedora reverts https://github.com/python/cpython/pull/28589 ("Fix threading._shutdown() for the main thread (https://github.com/python/cpython/pull/28549)") in Python 3.9 to 3.12. Python 3.13 works again without the revert since thread shutdown was rewritten by the commit 33da0e844c922b3dcded75fbb9b7be67cb013a17. Example:
Python 3.9-3.11 no longer gets bugfixes. I don't think that we should/can change this in Python 3.12 (IMO it's too late). There is a way to work around the issue in mod_wsgi.
(It appears it affects Python 3.12 for Fedora, so I also put 3.11 and 3.12 labels)
Python 3.12 provided by Fedora should not be affected since it has the revert.
Bug report
Bug description:
I have encountered a deadlock during subinterpreter shutdown after upgrading from Python 3.9.7 to 3.9.8. Git bisection reveals that #28589 ("Fix threading._shutdown() for the main thread (GH-28549)") is the culprit.
This is the gdp stacktrace for the only thread in Python code at the time of the deadlock:
I believe this could be the same issue described by GrahamDumpleton/mod_wsgi#730 and this commit is reverted in each version of Fedora Python e.g. for 3.12: fedora-python/cpython@4b35a8e. However, I have not been able to find an existing cpython report for the problem.
CPython versions tested on:
3.9, 3.10
Operating systems tested on:
Linux