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-96827: Don't touch closed loops from executor threads#96837

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
gvanrossum merged 4 commits intopython:mainfromgvanrossum:asyncio-thread-late
Sep 30, 2022

Conversation

gvanrossum
Copy link
Member

It's possible for an event loop's default executor to survive the loop. When the executor is finally shut down, a few things try to wake up the loop, and nasty RuntimeErrors are printed. But there's nothing the executor can do about that, so let's just not even try.

This is a draft PR because I haven't figured out a way to test this properly. (There's a repro in the issue,GH-96827.)

@gvanrossumgvanrossum marked this pull request as ready for reviewSeptember 29, 2022 22:06
@gvanrossum
Copy link
MemberAuthor

At this point (after investing over an hour of my time) I feel it's not worth it to try and come up with a test that reproduces the original issue. The changes appear straightforward enough: in certain edge cases don't attempt to set a future's state when its loop is already closed.

Copy link
Contributor

@kumaraditya303kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@kumaraditya303kumaraditya303 added needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsSep 30, 2022
@gvanrossumgvanrossum merged commite9d6376 intopython:mainSep 30, 2022
@miss-islington
Copy link
Contributor

Thanks@gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@gvanrossumgvanrossum deleted the asyncio-thread-late branchSeptember 30, 2022 19:55
@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelSep 30, 2022
@bedevere-bot
Copy link

GH-97690 is a backport of this pull request to the3.11 branch.

@bedevere-bot
Copy link

GH-97691 is a backport of this pull request to the3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10only security fixes labelSep 30, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 30, 2022
…nGH-96837)* When chaining futures, skip callback if loop closed.* When shutting down an executor, don't wake a closed loop.(cherry picked from commite9d6376)Co-authored-by: Guido van Rossum <guido@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 30, 2022
…nGH-96837)* When chaining futures, skip callback if loop closed.* When shutting down an executor, don't wake a closed loop.(cherry picked from commite9d6376)Co-authored-by: Guido van Rossum <guido@python.org>
miss-islington added a commit that referenced this pull requestSep 30, 2022
* When chaining futures, skip callback if loop closed.* When shutting down an executor, don't wake a closed loop.(cherry picked from commite9d6376)Co-authored-by: Guido van Rossum <guido@python.org>
miss-islington added a commit that referenced this pull requestSep 30, 2022
* When chaining futures, skip callback if loop closed.* When shutting down an executor, don't wake a closed loop.(cherry picked from commite9d6376)Co-authored-by: Guido van Rossum <guido@python.org>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestOct 2, 2022
…n#96837)* When chaining futures, skip callback if loop closed.* When shutting down an executor, don't wake a closed loop.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@gvanrossum@miss-islington@bedevere-bot@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp