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

http2: send GOAWAY properly & don't continue reading unnecessarily #20772

Closed

Conversation

apapirovski
Copy link
Member

@apapirovski apapirovski commented May 16, 2018

Fix an issue where http2 wasn't correctly submitting Goaway frames for the session, as well as handle the case where ECONNRESET occurs after such a Goaway frame is received.

Fixes: #20705
Fixes: #20750
Fixes: #20850

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@apapirovski apapirovski added the http2 Issues or PRs related to the http2 subsystem. label May 16, 2018
@nodejs-github-bot nodejs-github-bot added dont-land-on-v4.x http2 Issues or PRs related to the http2 subsystem. labels May 16, 2018
@apapirovski

This comment has been minimized.

@apapirovski

This comment has been minimized.

@apapirovski

This comment has been minimized.

@apapirovski apapirovski force-pushed the fix-http2-destroy-socket branch 2 times, most recently from 143e42a to f066642 Compare May 19, 2018 03:37
@apapirovski apapirovski changed the title http2: don't prematurely destroy the socket http2: send GOAWAY properly & don't continue reading unnecessarily May 19, 2018
@apapirovski

This comment has been minimized.

@apapirovski
Copy link
Member Author

@nodejs/http2 @addaleax This PR is mostly getting there in fixing several important bugs in http2 but I'm tripped up on Windows and FreeBSD. Does anyone here have a Windows system handy? If so, could you build it with --debug-http2 & run NODE_DEBUG=http2 tools/test.py parallel/test-http2-client-upload-reject (or whatever the Windows equivalent is) and post the debug output from any of the failing runs?

@apapirovski
Copy link
Member Author

Or if anyone knows how to run a build with debug output on CI, that would also be amazing.

@Trott
Copy link
Member

Trott commented May 19, 2018

Or if anyone knows how to run a build with debug output on CI, that would also be amazing.

@nodejs/build

@Trott
Copy link
Member

Trott commented May 19, 2018

Or if anyone knows how to run a build with debug output on CI, that would also be amazing.

@nodejs/build

@nodejs/testing too

@mcollina
Copy link
Member

I might be able to get the windows output next week, if it's still needed.

@apapirovski
Copy link
Member Author

Took me forever but managed to build Node on FreeBSD. Let's see what it says... :)

@apapirovski apapirovski force-pushed the fix-http2-destroy-socket branch 4 times, most recently from b494797 to a37b938 Compare May 20, 2018 04:24
@apapirovski

This comment has been minimized.

Currently http2 does not properly submit Goaway frames when
a session is being destroyed. It also doesn't properly
handle when the other party severs the connection after
sending a Goaway frame, even though it should.
@apapirovski
Copy link
Member Author

Ok, we're mostly there. Windows is the only system outstanding and I actually think it's an issue with the two tests, rather than a bug in http2.

Long-term I'm planning to do a more significant refactoring of how http2 end/close/destroy flow works but for now this should be good enough.

kjin pushed a commit to kjin/node that referenced this pull request Aug 23, 2018
Currently http2 does not properly submit GOAWAY frames when a session
is being destroyed. It also doesn't properly handle when the other
party severs the connection after sending a GOAWAY frame, even though
it should.

Edge, IE & Safari are currently unable to handle empty TRAILERS
frames despite them being correctly to spec. Instead send an empty
DATA frame with END_STREAM flag in those situations.

Fix and adjust several flaky and/or incorrect tests.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request Aug 23, 2018
It's possible for the connections to take too long and since the server
is already unrefed, the process will just exit. Instead adjust the test
so that server unref only happens after all sessions have been
successfuly established and unrefed. That still tests the same condition
but will not fail under load.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request Sep 25, 2018
Currently http2 does not properly submit GOAWAY frames when a session
is being destroyed. It also doesn't properly handle when the other
party severs the connection after sending a GOAWAY frame, even though
it should.

Edge, IE & Safari are currently unable to handle empty TRAILERS
frames despite them being correctly to spec. Instead send an empty
DATA frame with END_STREAM flag in those situations.

Fix and adjust several flaky and/or incorrect tests.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request Sep 25, 2018
It's possible for the connections to take too long and since the server
is already unrefed, the process will just exit. Instead adjust the test
so that server unref only happens after all sessions have been
successfuly established and unrefed. That still tests the same condition
but will not fail under load.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request Oct 16, 2018
Currently http2 does not properly submit GOAWAY frames when a session
is being destroyed. It also doesn't properly handle when the other
party severs the connection after sending a GOAWAY frame, even though
it should.

Edge, IE & Safari are currently unable to handle empty TRAILERS
frames despite them being correctly to spec. Instead send an empty
DATA frame with END_STREAM flag in those situations.

Fix and adjust several flaky and/or incorrect tests.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
kjin pushed a commit to kjin/node that referenced this pull request Oct 16, 2018
It's possible for the connections to take too long and since the server
is already unrefed, the process will just exit. Instead adjust the test
so that server unref only happens after all sessions have been
successfuly established and unrefed. That still tests the same condition
but will not fail under load.

PR-URL: nodejs#20772
Fixes: nodejs#20705
Fixes: nodejs#20750
Fixes: nodejs#20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
BethGriggs pushed a commit that referenced this pull request Oct 17, 2018
Currently http2 does not properly submit GOAWAY frames when a session
is being destroyed. It also doesn't properly handle when the other
party severs the connection after sending a GOAWAY frame, even though
it should.

Edge, IE & Safari are currently unable to handle empty TRAILERS
frames despite them being correctly to spec. Instead send an empty
DATA frame with END_STREAM flag in those situations.

Fix and adjust several flaky and/or incorrect tests.

Backport-PR-URL: #22850
PR-URL: #20772
Fixes: #20705
Fixes: #20750
Fixes: #20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
BethGriggs pushed a commit that referenced this pull request Oct 17, 2018
It's possible for the connections to take too long and since the server
is already unrefed, the process will just exit. Instead adjust the test
so that server unref only happens after all sessions have been
successfuly established and unrefed. That still tests the same condition
but will not fail under load.

Backport-PR-URL: #22850
PR-URL: #20772
Fixes: #20705
Fixes: #20750
Fixes: #20850
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
5 participants