FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix h2-over-h2 connection proxying by pimterry · Pull Request #52368 · nodejs/node · GitHub

/ node Public

Fix h2-over-h2 connection proxying - #52368

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
pimterry:h2-kSession-bound-error
Apr 8, 2024
Merged

Fix h2-over-h2 connection proxying#52368
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
pimterry:h2-kSession-bound-error

Conversation

pimterry commented Apr 4, 2024

Copy link
Copy Markdown
Member

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) and kSession (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 of kSession to confirm. Notable parts include:

  • A slight simplification to callTimeout
  • Duplicating the kUpdateTimer call in setStreamTimeout

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.

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 4, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 4, 2024

Copy link
Copy Markdown
Collaborator

ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

debadree25 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 5, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

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
nodejs-github-bot merged commit 3fc8d22 into nodejs:main Apr 8, 2024

Copy link
Copy Markdown
Collaborator

Landed in 3fc8d22

pimterry deleted the h2-kSession-bound-error branch April 30, 2024 12:50
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52368
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52368
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This file contains hidden or 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
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 outstanding review comments, and a CI started. http2 Issues or PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot CONNECT http2-over-http2 in Node 20.12.0

7 participants


Back | FazBrowse Home | New Git URL