fix(asyncio): do not hang when async_playwright() is cancelled while connecting - #3178
Closed
Yury Semikhatsky (yury-s) wants to merge 2 commits into
Closed
fix(asyncio): do not hang when async_playwright() is cancelled while connecting#3178Yury Semikhatsky (yury-s) wants to merge 2 commits into
Yury Semikhatsky (yury-s) wants to merge 2 commits into
Conversation
…osoft#3144)" This reverts commit 86d3004.
…elled Cancelling __aenter__ left the driver process and the transport tasks running with no owner, so the driver died with EPIPE once the interpreter exited. - tear down via __aexit__ when startup fails or is cancelled - allow PipeTransport.request_stop() before the driver has spawned Fixes: microsoft/playwright#42296
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.
Summary
__abort__reply inChannel._abort()absorbs the cancellation thatasyncio.run()delivers at loop shutdown, so the loop never finishes closing__aexit__when__aenter__fails or is cancelled, so the driver process does not outlive the connection (without this it dies withEPIPEonce the interpreter exits)PipeTransport.request_stop()before the driver has spawnedAlternative to #3177, which keeps #3144 and instead makes its abort path survive loop shutdown.
Fixes microsoft/playwright#42296