Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-128639: Don't assume one thread in subinterpreter finalization#128640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
025cc17
Fix subinterpreter cleanup.
ZeroIntensityJan 8, 2025
eea3ba9
Add and fix tests.
ZeroIntensityJan 8, 2025
149e0cf
Add blurb
ZeroIntensityJan 8, 2025
1761c37
Fix threading tests.
ZeroIntensityJan 8, 2025
8febfbf
Fix test_embed.
ZeroIntensityJan 8, 2025
5a73ce1
Remove buggy test.
ZeroIntensityJan 8, 2025
a7cc3fe
Skip flaky test.
ZeroIntensityJan 8, 2025
7c44c0b
Add an assertion.
ZeroIntensityFeb 4, 2025
6551bfa
Remove stray newline.
ZeroIntensityFeb 5, 2025
f19e28d
Add another assertion.
ZeroIntensityFeb 5, 2025
02da72a
Merge branch 'main' into subinterpreter-thread-shutdown
ZeroIntensityFeb 7, 2025
a759540
Merge branch 'main' of https://github.com/python/cpython into subinte…
ZeroIntensityMar 28, 2025
76e4ec9
Use new is_after_fork parameter
ZeroIntensityMar 28, 2025
1555731
Apply suggestions from code review
ZeroIntensityMay 19, 2025
d61099e
Move call to finalize_subinterpreters()
ZeroIntensityMay 19, 2025
09851dc
Unskip the threading test.
ZeroIntensityMay 19, 2025
b223396
Add a comment for the test.
ZeroIntensityMay 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Apply suggestions from code review
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
  • Loading branch information
@ZeroIntensity@ericsnowcurrently
ZeroIntensity andericsnowcurrently authoredMay 19, 2025
commit1555731dc2ea6acb895f17f4e20d30fb9041dade
6 changes: 1 addition & 5 deletionsPython/pylifecycle.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1991,7 +1991,6 @@ resolve_final_tstate(_PyRuntimeState *runtime)

/* We might want to warn if main_tstate->current_frame != NULL. */

assert(main_tstate->interp == main_interp);
return main_tstate;
}

Expand All@@ -2007,8 +2006,6 @@ _Py_Finalize(_PyRuntimeState *runtime)

/* Get final thread state pointer. */
PyThreadState *tstate = resolve_final_tstate(runtime);
// We must be in the main interpreter
assert(tstate->interp == &runtime->_main_interpreter);

// Block some operations.
tstate->interp->finalizing = 1;
Expand DownExpand Up@@ -2513,8 +2510,7 @@ finalize_subinterpreters(void)
while (interp != NULL) {
/* Make a tstate for finalization. */
PyThreadState *tstate = _PyThreadState_NewBound(interp, _PyThreadState_WHENCE_FINI);
if (tstate == NULL)
{
if (tstate == NULL) {
// XXX Some graceful way to always get a thread state?
Py_FatalError("thread state allocation failed");
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp