-
Notifications
You must be signed in to change notification settings - Fork 916
Gracefully handle GOAWAY #1479
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
Gracefully handle GOAWAY #1479
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1479 +/- ##
============================================
+ Coverage 73.81% 74.43% +0.61%
Complexity 720 720
============================================
Files 850 852 +2
Lines 26160 26175 +15
Branches 2018 2018
============================================
+ Hits 19311 19483 +172
+ Misses 5974 5803 -171
- Partials 875 889 +14
Continue to review full report at Codecov.
|
endpointDriver.channels.forEach(ch -> endpointDriver.goAway(ch, 1)); | ||
|
||
// Need to give a chance for the streams to get closed | ||
Thread.sleep(1000); |
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.
Have we run this enough to be convinced it isn't flaky?
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.
1s is a pretty long time to close 2 connections so it should be fine
if (streamId == 3) { | ||
stream3Received.complete(null); | ||
} | ||
|
||
if (streamId < 5) { | ||
Http2Headers outboundHeaders = new DefaultHttp2Headers() | ||
.status("200") | ||
.add("content-type", "text/plain") | ||
.addInt("content-length", getPayload.length); | ||
|
||
frameWriter().writeHeaders(ctx, streamId, outboundHeaders, 0, false, ctx.newPromise()); | ||
ctx.flush(); | ||
} |
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 probably missing something. Why 3 and 5 when there's only 2 requests?
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.
The client always initiates streams using odd numbers. The first stream used to establish the H2 stream is 1, so the next two are 3 and 5.
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.
Ah, cool!
@@ -62,7 +74,7 @@ public void closeWaitsForConnectionToBeReleasedBeforeClosingConnectionPool() thr | |||
Promise<Void> releasePromise = Mockito.spy(new DefaultPromise<>(loopGroup.next())); | |||
Mockito.doCallRealMethod().when(releasePromise).await(); | |||
releasePromise.setSuccess(null); | |||
Mockito.when(connectionPool.release(Mockito.eq(channel))).thenReturn(releasePromise); | |||
Mockito.when(connectionPool.release(eq(channel))).thenReturn(releasePromise); |
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.
Do we need this file, still?
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 can revert this
- Ensure that the GOAWAY exception is fired within each child channel's event loop to ensure correct ordering - Fix off-by-one error in MultiplexedChannelRecord - Add tests using a minimal H2 endpoint implementation - Remove test-server module since it's no longer needed
5acb3e0
to
4e4c411
Compare
if (streamId == 3) { | ||
stream3Received.complete(null); | ||
} | ||
|
||
if (streamId < 5) { | ||
Http2Headers outboundHeaders = new DefaultHttp2Headers() | ||
.status("200") | ||
.add("content-type", "text/plain") | ||
.addInt("content-length", getPayload.length); | ||
|
||
frameWriter().writeHeaders(ctx, streamId, outboundHeaders, 0, false, ctx.newPromise()); | ||
ctx.flush(); | ||
} |
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.
Ah, cool!
…7dad42406 Pull request: release <- staging/285aae68-af2e-4c5c-a25a-81d7dad42406
Description
Ensure that the GOAWAY exception is fired within each child channel's event
loop to ensure correct ordering
Fix off-by-one error in MultiplexedChannelRecord
Add tests using a minimal H2 endpoint implementation
Remove test-server module since it's no longer needed
Motivation and Context
Bug fix.
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsLicense