gh-128639: Don't assume one thread in subinterpreter finalization#128640
gh-128639: Don't assume one thread in subinterpreter finalization#128640ericsnowcurrently merged 17 commits intopython:mainfrom
Conversation
| Py_NewInterpreter(); | ||
| Py_NewInterpreter(); | ||
| Py_NewInterpreter(); | ||
| PyThreadState *tstate = PyThreadState_Get(); |
There was a problem hiding this comment.
I think this test working before was a fluke. Py_NewInterpreter changes the thread state, and I don't think we support calling Py_Finalize from a subinterpreter.
There was a problem hiding this comment.
It's probably okay but your change helps future-proof the test.
ericsnowcurrently
left a comment
There was a problem hiding this comment.
mostly LGTM
There are a few things that might make more sense in a separate PR.
| Py_NewInterpreter(); | ||
| Py_NewInterpreter(); | ||
| Py_NewInterpreter(); | ||
| PyThreadState *tstate = PyThreadState_Get(); |
There was a problem hiding this comment.
It's probably okay but your change helps future-proof the test.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
ericsnowcurrently
left a comment
There was a problem hiding this comment.
LGTM
Thanks for doing this!
|
@hugovk, is this something you'd be okay with us backporting to 3.14? |
|
Yep, crash bugfixes can be backported :) |
|
Thanks @ZeroIntensity for the PR, and @ericsnowcurrently for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…on (pythongh-128640) Incidentally, this also fixed the warning not showing up if a subinterpreter wasn't cleaned up via _interpreters.destroy. I had to update some of the tests as a result. (cherry picked from commit 9859791) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
GH-134254 is a backport of this pull request to the 3.14 branch. |
|
…nalization (pythongh-128640)" This reverts commit 9859791.
…inalization (pythongh-128640)" (pythongh-134256) This reverts commit 27bd082.
…on (pythongh-128640) Incidentally, this also fixed the warning not showing up if a subinterpreter wasn't cleaned up via _interpreters.destroy. I had to update some of the tests as a result.
…nalization (pythongh-128640)" (pythongh-134256) This reverts commit 9859791. The original change broke the iOS and android buildbots, where the tests are run single-process.
…on (pythongh-128640) Incidentally, this also fixed the warning not showing up if a subinterpreter wasn't cleaned up via _interpreters.destroy. I had to update some of the tests as a result.
…nalization (pythongh-128640)" (pythongh-134256) This reverts commit 9859791. The original change broke the iOS and android buildbots, where the tests are run single-process.
…on with fixed daemon thread support (pythonGH-134606) This reapplies pythonGH-128640. (cherry picked from commit a648813) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Incidentally, this also fixed the warning not showing up if a subinterpreter wasn't cleaned up via
_interpreters.destroy. I had to update some of the tests as a result.