Repository navigation
Fix race in MockWebServer's Http2SocketHandler - #9879
Merged
yschimke merged 1 commit intoNov 22, 2026
Merged
Conversation
Collaborator
|
JDK 8 error is unrelated |
yschimke
reviewed
Nov 22, 2026
| socket = socket, | ||
| requestLine = DEFAULT_REQUEST_LINE_HTTP_2, | ||
| ) | ||
| handleSocketEffect(peek.onRequestStart, socket, stream) |
Collaborator
There was a problem hiding this comment.
ok, so handling here makes sure we have already called dispatcher.dispatch(request) so we can't peek that event twice.
Contributor
Author
There was a problem hiding this comment.
Yep, adding logs + the thread sleep would always show the retry peeking the same event before dispatching in those test cases.
Also I can look into some of those configuration cache errors.
yschimke
approved these changes
Nov 22, 2026
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.
Fixes #9369 and #9673
Altogether this should fix these 15 flaky test cases:
You can reproduce these test failures in
mainby adding a thread sleep beforedispatchBookkeepingRequest:This was flaky because the bookkeeping dispatch usually beat the client's retry.
I think the race may have been introduced in #8870 as it switched the order of closing the stream and dispatching.