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-145541: Fix InvalidStateError in BaseSubprocessTransport._call_connection_lost()#145554

Open
daandemeyer wants to merge 2 commits intopython:mainfrom
daandemeyer:fix
Open

gh-145541: Fix InvalidStateError in BaseSubprocessTransport._call_connection_lost()#145554
daandemeyer wants to merge 2 commits intopython:mainfrom
daandemeyer:fix

Conversation

@daandemeyer
Copy link

@daandemeyerdaandemeyer commentedMar 5, 2026
edited by bedevere-appbot
Loading

Changeif not waiter.cancelled() toif not waiter.done() in both
_try_finish() and _call_connection_lost() so that waiters whose result
was already set by _try_finish() are not set again by
_call_connection_lost(), which would raise InvalidStateError.

When _connect_pipes is cancelled (e.g. by SIGINT during subprocess
creation), _pipes_connected stays False. If the process then exits,
_try_finish() sets the result on exit waiters because _pipes_connected
is False, and then schedules _call_connection_lost() because all pipes
are disconnected. _call_connection_lost() must skip waiters that are
already done.

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@python-cla-bot
Copy link

python-cla-botbot commentedMar 5, 2026
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@vstinner
Copy link
Member

Please set a more useful title than "wip" for your PR draft.

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@daandemeyerdaandemeyer changed the titlegh-145541: wipgh-145541: Fix InvalidStateError in BaseSubprocessTransport._call_connection_lost()Mar 5, 2026
@daandemeyerdaandemeyer marked this pull request as ready for reviewMarch 5, 2026 18:16
…ll_connection_lost()Change `if not waiter.cancelled()` to `if not waiter.done()` in both_try_finish() and _call_connection_lost() so that waiters whose resultwas already set by _try_finish() are not set again by_call_connection_lost(), which would raise InvalidStateError.When _connect_pipes is cancelled (e.g. by SIGINT during subprocesscreation), _pipes_connected stays False. If the process then exits,_try_finish() sets the result on exit waiters because _pipes_connectedis False, and then schedules _call_connection_lost() because all pipesare disconnected. _call_connection_lost() must skip waiters that arealready done.
@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

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

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303kumaraditya303 is a code owner

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@daandemeyer@vstinner

[8]ページ先頭

©2009-2026 Movatter.jp