-
Notifications
You must be signed in to change notification settings - Fork 30k
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: use session not socket timeout, tests #15188
Conversation
Also something I just noticed, this earlier PR should probably be revisited in light of this #15106 — I'm not sure if all of it is relevant anymore? |
fec3fdd
to
d669eeb
Compare
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.
Can you please check if this affect performance anyhow?
Assuming it does not cause a regression.. LGTM
Will test later today but I would be surprised if it doesn't affect performance at least a little bit. For one, |
I think the failures on Mac OS X are unrelated. Let us know about the performance impact. @jasnell what do you think? |
Will need to figure out how to get h2load built on a Mac so this might take me a little while. Will update when I make it work. |
@mcollina It's not too bad after all.
Not too surprising that there's a tiny bit of a hit since before this PR the timeouts were completely bugged and weren't doing anything (basically no-op). Same benchmark with
Edit: This is after 40 runs on each node version btw. |
lib/internal/http2/core.js
Outdated
debug('session timeout'); | ||
process.nextTick(() => { | ||
// if destroyed or destryoing, do nothing | ||
if (this.destroyed || this.destroying) |
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.
should be faster to use the kState
references here instead of the getters
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.
Posting an updated version shortly. Thanks for the review!
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 with green CI
d669eeb
to
5b74d59
Compare
There was too much red in the last CI run, trying again: https://ci.nodejs.org/job/node-test-commit/12214/ |
CI is definitely not green on this one: https://ci.nodejs.org/job/node-test-commit-linuxone/8427/nodes=rhel72-s390x/console @apapirovski ... can you take a look? btw, I really appreciate that you've jumped in on these. PR's from new contributors make me super happy :-) |
I think the test might be flaky because of the low timeout. Will look into it. |
@jasnell can we run the CI again? I adjusted the timing to be less strict to match some of the other timeout tests. At 20ms the margin for error was too small. |
991825b
to
16027d2
Compare
This does not land cleanly on master, can you please rebase and squash? |
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: nodejs#15158
16027d2
to
e06e885
Compare
All done. |
Landed as 46133b5 |
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: #15158 PR-URL: #15188 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: #15158 PR-URL: #15188 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: #15158 PR-URL: #15188 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: #15158 PR-URL: #15188 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Change default timeout to be tracked on the session instead of the socket, as nghttp2 manages the socket and we would need to maintain two sets of timeouts for similar purpose. Also fixes session setTimeout to work as it wasn't getting _unrefActive correctly (was called on the handle). Fixes: nodejs#15158 PR-URL: nodejs#15188 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This fixes #15158. Two changes included:
_unrefActive
was being called on the handler rather than the actual sessionMarked as WIP as I think we need to investigate whether socket timeout is necessary anywhere and also because this needs a lot more tests, ideally.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2, test