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.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix race condition that caused LaunchAsync to never resolve for chrome #2214
Fix race condition that caused LaunchAsync to never resolve for chrome #2214
Changes from 14 commits
ca95043
5a5391b
f58262f
aabb86e
deb351d
84c3dd5
dda9812
91c5e2b
7e65695
0d3a600
16b9283
d7d6617
e8199a6
f22b62a
1bbb87f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we are trying to enforce this. What do you think about using
WithTimeout
, and throwing an exception? If we fail to complete this task somehow, the code will get stuck here.The same for the other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that
_targetDiscoveryCompletionSource
will be set if and only if the messageTarget.setDiscoverTargets
completes. I can't think of any scenario where it wouldn't complete.There's no code that uses a timeout value in ChromeTargetManager. Where should I derive the timeout value from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use
Puppeteer.DefaultTimeout
. It's quite a long timeout. We want to prevent the code from hanging.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noticing that we now only execute
((Target)Target).CloseTask
ifClient.Connection.SendAsync("Target.closeTarget"
completes successfully.Should we still execute
((Target)Target).CloseTask
ifClient.Connection.SendAsync("Target.closeTarget"
throws an exception?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnyrup this matches upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, I based it on upstream.
If
Target.closeTarget
fails, it's very likely thatTargetManager_TargetGone
will not be invoked, and the await ofCloseTask
would block the code indefinitely.