Skip to content

quic: Implement callback for http/3 settings/application options#63558

Merged
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
martenrichter:http3settings
Jun 10, 2026
Merged

quic: Implement callback for http/3 settings/application options#63558
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
martenrichter:http3settings

Conversation

@martenrichter

Copy link
Copy Markdown
Contributor

Implements a callback that is invoked once http/3 settings are received.
Background, http/3 settings usually arrive a bit later than connection establishment, and e.g. for
webtransport these settings are used to indicate support. So e.g. the examples for quiche from google, wait for the settings to arrive. (This is different to http/2).
The implemented callback mechanism allows to wait for the settings to arrive until connection attempts are made.
As settings are stored in the generic applications option object, the callback's name refers to the application rather than the settings.
Whether this is a good choice is debatable.

Fixes: #63553

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 25, 2026
@martenrichter martenrichter force-pushed the http3settings branch 3 times, most recently from d6acf53 to eb500d1 Compare May 25, 2026 13:14
Implements a callback that is invoked once http/3
settings are received.
Background, http/3 settings usually arrive a bit
later than connection establishment, and e.g. for
webtransport these settings are used to indicate
support. So e.g. the examples for quiche from
 google, wait for the settings to arrive.
 (This is different to http/2).
The implemented callback mechanism allows to wait
for the settings to arrive until connection
attempts are made. As settings are stored in the
generic applications option object, the callback's
 name refers to the application rather than the
 settings. Whether this is a good choice is
 debatable.

Fixes: nodejs#63553
Signed-off-by: Marten Richter <marten.richter@freenet.de>
Comment thread src/quic/session.cc
Comment thread doc/api/quic.md
Comment thread src/quic/session.cc Outdated
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.34%. Comparing base (8d3245e) to head (9c5942b).
⚠️ Report is 182 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63558      +/-   ##
==========================================
+ Coverage   90.14%   90.34%   +0.19%     
==========================================
  Files         718      730      +12     
  Lines      227984   234547    +6563     
  Branches    42835    43909    +1074     
==========================================
+ Hits       205522   211906    +6384     
- Misses      14235    14383     +148     
- Partials     8227     8258      +31     
Files with missing lines Coverage Δ
lib/internal/quic/diagnostics.js 100.00% <100.00%> (ø)
lib/internal/quic/quic.js 100.00% <100.00%> (ø)
lib/internal/quic/state.js 100.00% <100.00%> (ø)
lib/internal/quic/symbols.js 100.00% <100.00%> (ø)

... and 117 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bjohansebas bjohansebas 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.

LGMT!

@martenrichter

Copy link
Copy Markdown
Contributor Author

OK, I am ready, so can someone from you push it?

@bjohansebas bjohansebas added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels May 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jasnell

jasnell commented May 25, 2026

Copy link
Copy Markdown
Member

@nodejs/quic

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@pimterry pimterry 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.

Thanks @martenrichter! This'll definitely be useful.

I'd prefer to change the name, I could be persuaded there if others disagree though.

The other comments are a couple of clear little bugs we should definitely fix.

Comment thread doc/api/quic.md
The endpoint that created this session. Returns `null` if the session
has been destroyed. Read only.

### `session.onapplication`

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.

The naming here is confusing, as you mentioned in the description, since it doesn't emit an application as such. This isn't a generic QUIC thing at all (transport parameters are a separate thing with a different flow) and right now this won't work for anything except HTTP/3. While some other protocols have equivalents it's not clear how closely they would all map to the model, and they definitely all have different names & structures anyway.

For HTTP/3, the RFC calls those 'settings', we use localSettings/remoteSettings in our existing HTTP/2 API. Since this is basically HTTP only and there's no umbrella term, I'd suggest this say 'settings' somewhere explicitly. Just onsettings would work fine from my pov. The rest of our HTTP-specific stuff (onheaders) doesn't explicitly name HTTP in the API naming so that seems consistent.

Beyond this PR: the HTTP/QUIC ambiguity here in the API ties a bit into my thoughts about the request timeout stuff @jasnell - starting to wonder whether we should separate the QUIC & HTTP/3 APIs more explicitly, to make this kind of thing cleaner. The distinction is very blurred together right now and we do lots of HTTP-shaped things for QUIC. Looks doable to split it a bit, really just an API restructuring rather than internals, but there'd be plenty of details to work out. Not required for this PR at all, just fyi, when I have time next week I'll take a look around it as a more general topic and try to open a rough draft to discuss, I have some ideas that'd be fun to explore 😄.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The problem with the naming is, that it dates back to the choice that the http/3 settings are all inside the quic.ApplicationOptions . So I had to decide to call it onsettings , which would be my preferred choice for http/3 settings, or stick with the generic term applicationoptions (though I shortened it to onapplication as it was already very long).

So I think it is kind of a general decision. I have so far just flipped a coin.

Regarding the HTTP/QUIC ambiguity, I am playing around with how to implement webtransport and ngtcp2, and I think you can even wrap the WT streams to the QuicStream and have a mixture of streams. Even if it is confusing, it works some way.

P.S: I try to cover the minor stuff. As I do it in my free time, and the holiday day today is over it may take until next weekend.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Minor stuff should be all covered. I am now waiting for consensus on the naming scheme.

Comment thread lib/internal/quic/quic.js Outdated
Comment thread lib/internal/quic/quic.js
Comment thread lib/internal/quic/quic.js Outdated

@pimterry pimterry 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.

Fixes look good. I'd prefer something with 'settings' in the name, but happy to merge as is & change it later if there's no immediate consensus.

@martenrichter

Copy link
Copy Markdown
Contributor Author

Let's see if someone else has an opinion. (I do not have a one...., of course I am happy with no renaming work yet).

@martenrichter

Copy link
Copy Markdown
Contributor Author

Ok, as there was no further feedback regarding renaming. Can someone with permissions merge it? (Or say that I should change it). This would be nice.

@mcollina 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.

lgtm

@mcollina

mcollina commented Jun 9, 2026

Copy link
Copy Markdown
Member

@martenrichter we need to wait for @pimterry.

@pimterry pimterry added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jun 9, 2026
@pimterry

pimterry commented Jun 9, 2026

Copy link
Copy Markdown
Member

Oh, I did approve before already. Happy to go ahead as is, I'll commit-queue now.

I have some broader plans for the HTTP/3 APIs in progress anyway (splitting them a bit from QUIC) which might juggle naming around, so happy to avoid bike shedding it in the meantime.

@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 9, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/63558
✔  Done loading data for nodejs/node/pull/63558
----------------------------------- PR info ------------------------------------
Title      quic: Implement callback for http/3 settings/application options (#63558)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     martenrichter:http3settings -> nodejs:main
Labels     c++, lib / src, author ready, needs-ci, quic, commit-queue-squash
Commits    6
 - quic: impl. cb for http/3 settings/app. options
 - quic: add documentation for OnApplicationCallback
 - quic: Session::EmitApplication optimization
 - quic: http/3 settings bug fixes and added tests
 - quic: Fix http/3 settings test
 - quic: Fix linting
Committers 1
 - Marten Richter <marten.richter@tu-berlin.de>
PR-URL: https://github.com/nodejs/node/pull/63558
Fixes: https://github.com/nodejs/node/issues/63553
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/63558
Fixes: https://github.com/nodejs/node/issues/63553
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 25 May 2026 12:45:25 GMT
   ✔  Approvals: 4
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/63558#pullrequestreview-4357448045
   ✔  - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/63558#pullrequestreview-4362329168
   ✔  - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/63558#pullrequestreview-4378160632
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/63558#pullrequestreview-4459792383
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-05-25T17:19:03Z: https://ci.nodejs.org/job/node-test-pull-request/73717/
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - quic: http/3 settings bug fixes and added tests
   ⚠  - quic: Fix http/3 settings test
   ⚠  - quic: Fix linting
- Querying data for job/node-test-pull-request/73717/
✔  Build data downloaded
- Querying failures of job/node-test-commit/88213/
✔  Data downloaded
   ✘  2 failure(s) on the last Jenkins CI run
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/27216816696

@martenrichter

martenrichter commented Jun 9, 2026 via email

Copy link
Copy Markdown
Contributor Author

@pimterry pimterry added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 9, 2026
@pimterry

pimterry commented Jun 9, 2026

Copy link
Copy Markdown
Member

Regarding this, I am playing around locally with webtransport based on the nghttp3 pr on this topic. Required changes are minimal, would it make sense to share it know, even if it does not work everything, so that you can consider it in these changes?

That'd definitely be interesting to look at, absolutely. Right now while everything is still early and relatively malleable the more use cases & API inspiration the better imo.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 9, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@pimterry pimterry added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 10, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 10, 2026
@nodejs-github-bot nodejs-github-bot merged commit e6a8d06 into nodejs:main Jun 10, 2026
85 of 86 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in e6a8d06

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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quic: http/3 callback required if settings are received

7 participants