-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Fix h2-over-h2 connection proxying #52368
Merged
nodejs-github-bot
merged 1 commit into
nodejs:main
from
pimterry:h2-kSession-bound-error
Apr 8, 2024
Merged
Fix h2-over-h2 connection proxying #52368
nodejs-github-bot
merged 1 commit into
nodejs:main
from
pimterry:h2-kSession-bound-error
Apr 8, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Review requested:
|
nodejs-github-bot
added
http2
Issues or PRs related to the http2 subsystem.
needs-ci
PRs that need a full CI run.
labels
Apr 4, 2024
mcollina
approved these changes
Apr 4, 2024
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
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Apr 4, 2024
ShogunPanda
approved these changes
Apr 5, 2024
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!
debadree25
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Apr 5, 2024
marco-ippolito
approved these changes
Apr 7, 2024
mcollina
added
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Apr 8, 2024
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Apr 8, 2024
Landed in 3fc8d22 |
marco-ippolito
pushed a commit
that referenced
this pull request
May 2, 2024
PR-URL: #52368 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
Merged
marco-ippolito
pushed a commit
that referenced
this pull request
May 3, 2024
PR-URL: #52368 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
richardlau
added
backported-to-v20.x
PRs backported to the v20.x-staging branch.
and removed
lts-watch-v20.x
PRs that may need to be released in v20.x
labels
May 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
backported-to-v20.x
PRs backported to the v20.x-staging branch.
http2
Issues or PRs related to the http2 subsystem.
needs-ci
PRs that need a full CI run.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #52344.
Previously,
kSession
was used on sockets to track the HTTP/2 session happening within that socket, and used on HTTP/2 streams to track the HTTP/2 session containing that stream (i.e. opposite directions in the connection 'stack').This works fine most of the time, but when a HTTP/2 stream is used as the base for another HTTP/2 connection (using CONNECT proxying over an HTTP/2 stream) these two meanings conflict.
This didn't break until v20.12.0 because in that scenario a JS stream socket is used, and
kSession
was not passed through that layer until c50524a#diff-8dd7127678f00bf090a030256bad7ae645834f7100e54154b4fc81c8cbe9c3fc.This fixes the issue by splitting into
kBoundSession
(the HTTP/2 session the socket is bound to) andkSession
(the HTTP/2 session containing an HTTP/2 stream). I'm fairly sure I've updated all socket-specific use cases correctly to make that change, but it's worth carefully checking the uses ofkSession
to confirm. Notable parts include:callTimeout
kUpdateTimer
call insetStreamTimeout
I think all these changes are exactly equivalent to the previous behaviour, except in the one edge case where something both contains and is contained by an HTTP/2 session.
I'm not sure the
setStreamTimeout
behaviour is actually correct (I'm not sure I fully understand the wider implications of that logic) but it is equivalent to the previous behaviour anyway so hopefully that's OK for now. Happy to change that to only do one or the other call if only one is actually correct.