-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: fix responses to long payload reqs #20084
Conversation
9897506
to
a6c958f
Compare
Have to update this to support the new trailers implementation. |
56364b9
to
edb4d4c
Compare
Ok, one related failure in Edit: I think this might be not directly related to this change but rather these changes are exposing another existing bug? Debugging. Hopefully have a fix soon. |
Ok, so there was indeed an unrelated issue around not flushing pending data when sending RST_STREAM. This commit takes care of that: 1f29ad5 This is tied into how nghttp2 handles RST_STREAM frames: nghttp2/nghttp2#692 (with higher priority than others). Definitely open to suggestions on how to do it better! |
@@ -26,7 +26,7 @@ const obs = new PerformanceObserver(common.mustCall((items) => { | |||
switch (entry.type) { | |||
case 'server': | |||
assert.strictEqual(entry.streamCount, 1); | |||
assert.strictEqual(entry.framesReceived, 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.
This is already flaky on master
but exacerbated by some of the changes here. I think it might be timing sensitive? Minimum seems to be 3.
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.
+1 for the fix, can you add a comment?
Failure in https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1604_sharedlibs_debug_x64/3797/tapResults/ seems potentially related but no clue how I'm causing SIGABRT... Let's try something... CI: https://ci.nodejs.org/job/node-test-pull-request/14352/ Stress test CI: https://ci.nodejs.org/job/node-stress-single-test/1819/nodes=ubuntu1604-64/console |
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.
LGTM
@BridgeAR still awaiting your final review on this before landing. |
@ryzokuken I guess you meant @addaleax? |
@BridgeAR wait, sorry. Wrong thread. I need more rest, I think. |
P.S. It was #19898 |
If this is going to make it in to 10.0.0 it really needs to get landed today. |
plinux CI rerun: https://ci.nodejs.org/job/node-test-commit-plinux/17081/ |
2a9f101
to
2228f59
Compare
Last CI run before landing: https://ci.nodejs.org/job/node-test-pull-request/14564/ |
2228f59
to
21f0e82
Compare
Landed in b55a11d |
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. PR-URL: #20084 Fixes: #20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. PR-URL: #20084 Fixes: #20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. PR-URL: nodejs#20084 Fixes: nodejs#20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
@apapirovski I've been trying to do a backport of http2 commits to 8.x, but this commit has been giving me some trouble, as its passing tests is reliant on a PR (#18438) that is marked as semver-major. A number of following PRs depend on this one, so this seems to be a big factor in what can be backported correctly. What are your thoughts on this? (cc/ @jasnell, @mcollina, @addaleax) |
@kjin I will have a look at it and see if I can help out. Do you have a branch you're working against that I could pull down to do my work on? |
@apapirovski Thanks! The current branch is here and fairly up-to-date against v8.x-staging. If I were to add the commit associated with this PR it would go right on top. |
Hi @apapirovski -- after going through the rest of the commits, it turns out that backporting the commits in #20772 seems to fix the failing tests from this PR. Given that you are the author of both PRs, does this seem logical to you, or do you know if any change in #20772 would mask the issues arising here? |
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. PR-URL: nodejs#20084 Fixes: nodejs#20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. PR-URL: nodejs#20084 Fixes: nodejs#20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload. Add a conditional Http2Stream.close call that runs only if the user hasn't attempted to read the stream. Backport-PR-URL: #22850 PR-URL: #20084 Fixes: #20060 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload if the payload exceeds the initial window size. Add a conditional
Http2Stream#close
call that runs only if its a server-side stream, the user hasn't attempted to read the stream & there is no resume call scheduled.With all that said, I hope someone has some good ideas that will make this less of a monster...
Also, FWIW this should make writes slightly less brittle because right now it's possible to trigger a follow-up write from the
Done
callback which would then trigger the assert inSendPendingData
. In particular this tends to happen when using eitherdestroy
orclose
on a stream.Fixes: #20060
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes