bpo-37951: Lift subprocess's fork() restriction (GH-15544)#15544
Conversation
Signed-off-by: Christian Heimes <christian@python.org>
b76ff65 to
c91ab6c
Compare
vstinner
left a comment
There was a problem hiding this comment.
LGTM. Valid approach according to https://bugs.python.org/issue34651#msg325302
I just added a minor comment.
|
|
||
| The *preexec_fn* parameter is no longer supported in subinterpreters. | ||
| The new restriction may affect applications that are deployed in | ||
| mod_wsgi, uWSGI, and other environments. |
There was a problem hiding this comment.
I'm not sure that it's useful to document affected applications.
There was a problem hiding this comment.
The list of affected applications makes it easier for affected users to find the culprit. In my experience it's mostly embedded WSGI servers and embedded applications that use subinterpreters. mod_wsgi and uWSGI are the most common ones.
There was a problem hiding this comment.
When you say "no longer supported", here and in whatsnew, mention that use of it raises a RuntimeError.
There was a problem hiding this comment.
FWIW I do agree that most users probably are not aware that they're in a subinterpreter, so listing some common examples of such environments is not a bad thing.
There was a problem hiding this comment.
@gpshead The subinterpreter and whatsnew entries now mention RuntimeError.
|
I'll wait for ACK from either @gpshead or @ericsnowcurrently before I push the fix. |
| PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters"); | ||
| if ((preexec_fn != Py_None) && | ||
| (_PyInterpreterState_Get() != PyInterpreterState_Main())) { | ||
| PyErr_SetString(PyExc_RuntimeError, "preexec_fn not supported for subinterpreters"); |
There was a problem hiding this comment.
Yes, that makes sense. ETOOLAZY
|
@gpshead Please review again |
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
I'm having trouble backporting to |
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
GH-15554 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit 98d90f7) Co-authored-by: Christian Heimes <christian@python.org>
|
It will be in b4, yes. |
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue37951