Skip to content
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

Defer StreamResetException until response body buffer is fully read. #3960

Merged
merged 1 commit into from
Apr 12, 2018

Conversation

dave-r12
Copy link
Collaborator

@dave-r12 dave-r12 commented Apr 7, 2018

We rely on the application layer to read the response body buffer
before sending WINDOW_UPDATE's. Previously we'd immediately throw a
StreamResetException. This prevented the application layer from reading
the buffer which in turn means we would not send WINDOW_UPDATE's. This
has potential to deplete the flow-control window.

#3915

@dave-r12
Copy link
Collaborator Author

dave-r12 commented Apr 7, 2018

I'm not sure this is the right approach but I thought it was good enough to get a discussion started.

Copy link
Collaborator

@yschimke yschimke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low signal LGTM - nice work fixing this cancel bug.

pom.xml Outdated
@@ -164,7 +164,6 @@
<systemPropertyVariables>
<okhttp.platform>${okhttp.platform}</okhttp.platform>
</systemPropertyVariables>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary change? removing this overwhelms the normal Travis logs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, that's unfortunate. I'll revert.

We rely on the application layer to read the response body buffer
before sending WINDOW_UPDATE's. Previously we'd immediately throw a
StreamResetException. This prevented the application layer from reading
the buffer which in turn means we would not send WINDOW_UPDATE's. This
has potential to deplete the flow-control window.

#3915
@dave-r12 dave-r12 force-pushed the http2-connection-flow-control branch from 914bc56 to 691a82b Compare April 8, 2018 19:28
Copy link
Collaborator

@swankjesse swankjesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic

@@ -300,6 +301,40 @@ private static OkHttpClient buildHttp2Client() {
response2.close();
}

@Test public void connectionWindowUpdateAfterCanceling() throws Exception {
server.enqueue(new MockResponse()
.setBody(new Buffer().write(new byte[Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE + 1])));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@swankjesse swankjesse merged commit e593e2e into master Apr 12, 2018
@JakeWharton JakeWharton deleted the http2-connection-flow-control branch June 12, 2018 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants