gh-119710: Let asyncio Process.wait() finish on only process exit.#151983
Open
tapetersen wants to merge 2 commits into
Open
gh-119710: Let asyncio Process.wait() finish on only process exit.#151983tapetersen wants to merge 2 commits into
tapetersen wants to merge 2 commits into
Conversation
|
The following commit authors need to sign the Contributor License Agreement: |
0578b66 to
aa43850
Compare
Letting Process.wait() only wait on actual process return is closer to how it's documented and consistent with Popen.wait(). This also reduces complexity for waking waiters which was inconsistend depending on ordering of wait/exit.
aa43850 to
44d3d9e
Compare
e774576 to
f6df3f5
Compare
tapetersen
commented
Jun 23, 2026
| exit_waiter = self.loop.create_future() | ||
| transport._exit_waiters.append(exit_waiter) | ||
|
|
||
| # _connect_pipes hasn't completed, so _pipes_connected is False. |
Author
There was a problem hiding this comment.
My inclination would be to remove this test fully since it should be covered by test_wait_even_if_pipe_is_open in a less implementation dependent way.
With a single place for notifying waiters (instead of 3) this feels too specific.
tapetersen
commented
Jun 23, 2026
Comment on lines
+241
to
+243
| for waiter in self._exit_waiters: | ||
| if not waiter.done(): | ||
| waiter.set_result(returncode) |
Author
There was a problem hiding this comment.
This could be changed back to not waiter.cancelled() (reverting that part of #145554) since this should now be the only place they are otherwise resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gh-119710: Let asyncio Process.wait() finish on only process exit
Letting Process.wait() only wait on actual process return is closer to how it's documented and consistent with Popen.wait(). This also reduces complexity for waking waiters which was inconsistend depending on ordering of wait/exit.