Skip to content

quic: add promise to QuicStream for pending strms - #65862

Merged
nodejs-github-bot merged 7 commits into
nodejs:mainfrom
martenrichter:addreadytoquicstream
Sep 12, 2026
Merged

quic: add promise to QuicStream for pending strms#65862
nodejs-github-bot merged 7 commits into
nodejs:mainfrom
martenrichter:addreadytoquicstream

Conversation

@martenrichter

Copy link
Copy Markdown
Contributor

before this PR, it was necessary to poll, if a
stream can not be created immediately due to
flow control.
This PR adds a promise to QuicStream, that fulfills, when a stream is available and ready.

@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 involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Sep 6, 2026
@martenrichter

Copy link
Copy Markdown
Contributor Author

@jasnell @pimterry that is the separate PR for a promise for pending streams

@bjohansebas bjohansebas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.16%. Comparing base (1dd48de) to head (4db975e).
⚠️ Report is 48 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65862      +/-   ##
==========================================
- Coverage   90.18%   90.16%   -0.03%     
==========================================
  Files         771      771              
  Lines      265451   265520      +69     
  Branches    50452    50466      +14     
==========================================
+ Hits       239398   239400       +2     
- Misses      16985    17058      +73     
+ Partials     9068     9062       -6     
Files with missing lines Coverage Δ
lib/internal/quic/quic.js 100.00% <100.00%> (ø)
lib/internal/quic/symbols.js 100.00% <100.00%> (ø)

... and 41 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.

Comment thread doc/api/quic.md Outdated
added: v23.8.0
-->

### `stream.ready`

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.

Imo stream.opened would be a slightly clearer API, to match session.opened and stream.stats.opened_at.

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.

Ok, I have changed it. (Will push soon). readycame from WebStream semantics.

Comment thread lib/internal/quic/quic.js Outdated
@trivikr trivikr added the quic Issues and PRs related to the QUIC transport implementation. label Sep 7, 2026
@jasnell
jasnell requested a review from pimterry September 8, 2026 17:49

@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 for the fixes @martenrichter. Code changes all look good to me.

In the docs though the name of the field is wrong, and there's now a conflict here so this'll need a rebase. Otherwise LGTM.

Comment thread doc/api/quic.md Outdated
-->

### `stream.ready`
### `stream.open`

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.

Docs say open, but the actual field is opened.

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.

Oh yes, fixed.

@jasnell

jasnell commented Sep 8, 2026

Copy link
Copy Markdown
Member

@martenrichter ... this will need to be rebased

before this PR, it was necessary to poll, if a
stream can not be created immediately due to
flow control.
This PR adds a promise to QuicStream, that fulfills,
when a stream is available and ready.

Signed-off-by: Marten Richter <marten.richter@freenet.de>
Comment thread src/quic/streams.cc Outdated
@martenrichter

Copy link
Copy Markdown
Contributor Author

Is rebased, but I am not sure with one change, please look at my comment.

@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 10, 2026
@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 10, 2026
@jasnell

jasnell commented Sep 10, 2026

Copy link
Copy Markdown
Member

CI is likely to fail due to a current unrelated issue on Windows. Hopefully that will be resolved shortly.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 10, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 12, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Sep 12, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

This pull request has multiple commits, but no landing policy was selected.

Add commit-queue-squash PRs the Commit Queue should land as one squashed commit. to land it as one commit, or commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. to land the commits separately.

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
- Loading data for nodejs/node/pull/65862
✔  Done loading data for nodejs/node/pull/65862
----------------------------------- PR info ------------------------------------
Title      quic: add promise to QuicStream for pending strms (#65862)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     martenrichter:addreadytoquicstream -> nodejs:main
Labels     c++, lib / src, author ready, needs-ci, quic, commit-queue
Commits    7
 - quic: add promise to QuicStream for pending strms
 - quic: fix lint
 - quic: use opened instead ready for QuicStream
 - quic: fix rejection of opened promise and add test
 - quic: fix lint and test
 - quic: fix doc opened instead of open
 - quic: move EmitStreamAvailable
Committers 1
 - Marten Richter <marten.richter@tu-berlin.de>
PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 06 Sep 2026 17:46:45 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/65862#pullrequestreview-5126181969
   ✔  - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/65862#pullrequestreview-5163047814
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-09-10T16:37:10Z: https://ci.nodejs.org/job/node-test-pull-request/77310/
- Querying data for job/node-test-pull-request/77310/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
   89b32cf16d..dff7a160fe  main       -> origin/main
✔  origin/main is now up-to-date
main is out of sync with origin/main. Mismatched commits:
 - 546a29107e lib: put node:bench behind an --experimental-bench flag
 - dff7a160fe lib: put node:bench behind an --experimental-bench flag
--------------------------------------------------------------------------------
HEAD is now at dff7a160fe lib: put node:bench behind an --experimental-bench flag
   ✔  Reset to origin/main
- Downloading patch for 65862
From https://github.com/nodejs/node
 * branch                  refs/pull/65862/merge -> FETCH_HEAD
✔  Fetched commits as c8b346e98e83..4db975e6c962
--------------------------------------------------------------------------------
[main 0e67097cf8] quic: add promise to QuicStream for pending strms
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Sun Sep 6 19:19:35 2026 +0200
 10 files changed, 92 insertions(+), 1 deletion(-)
[main 9442821931] quic: fix lint
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Sun Sep 6 19:57:55 2026 +0200
 2 files changed, 4 insertions(+)
[main ca51f85e6b] quic: use opened instead ready for QuicStream
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 07:54:12 2026 +0200
 4 files changed, 16 insertions(+), 16 deletions(-)
[main 131fdbcd71] quic: fix rejection of opened promise and add test
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 08:07:27 2026 +0200
 2 files changed, 15 insertions(+), 2 deletions(-)
[main 4019c67f4a] quic: fix lint and test
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 08:21:07 2026 +0200
 1 file changed, 2 insertions(+), 2 deletions(-)
[main e7d53bf13c] quic: fix doc opened instead of open
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Wed Sep 9 07:59:11 2026 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
[main 629e87079a] quic: move EmitStreamAvailable
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Thu Sep 10 06:57:30 2026 +0200
 1 file changed, 3 insertions(+), 3 deletions(-)
   ✔  Patches applied
There are 7 commits in the PR. Attempting autorebase.
(node:894) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: add promise to QuicStream for pending strms

before this PR, it was necessary to poll, if a
stream can not be created immediately due to
flow control.
This PR adds a promise to QuicStream, that fulfills,
when a stream is available and ready.

Signed-off-by: Marten Richter <marten.richter@freenet.de>
PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD bea11cd2c0] quic: add promise to QuicStream for pending strms
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Sun Sep 6 19:19:35 2026 +0200
 10 files changed, 92 insertions(+), 1 deletion(-)
Rebasing (3/14)
Rebasing (4/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fix lint

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 200421b674] quic: fix lint
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Sun Sep 6 19:57:55 2026 +0200
 2 files changed, 4 insertions(+)
Rebasing (5/14)
Rebasing (6/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: use opened instead ready for QuicStream

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 89a734f820] quic: use opened instead ready for QuicStream
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 07:54:12 2026 +0200
 4 files changed, 16 insertions(+), 16 deletions(-)
Rebasing (7/14)
Rebasing (8/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fix rejection of opened promise and add test

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 883913e631] quic: fix rejection of opened promise and add test
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 08:07:27 2026 +0200
 2 files changed, 15 insertions(+), 2 deletions(-)
Rebasing (9/14)
Rebasing (10/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fix lint and test

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD e15641f181] quic: fix lint and test
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Tue Sep 8 08:21:07 2026 +0200
 1 file changed, 2 insertions(+), 2 deletions(-)
Rebasing (11/14)
Rebasing (12/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fix doc opened instead of open

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 7b0f9dab1b] quic: fix doc opened instead of open
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Wed Sep 9 07:59:11 2026 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (13/14)
Rebasing (14/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: move EmitStreamAvailable

PR-URL: https://github.com/nodejs/node/pull/65862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD cc27e61997] quic: move EmitStreamAvailable
 Author: Marten Richter <marten.richter@tu-berlin.de>
 Date: Thu Sep 10 06:57:30 2026 +0200
 1 file changed, 3 insertions(+), 3 deletions(-)
Successfully rebased and updated refs/heads/main.
--------------------------------------------------------------------------------
   ℹ  Add `commit-queue-squash` label to land the PR as one commit, or `commit-queue-rebase` to land as separate commits.

View workflow run

@panva panva added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Sep 12, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 312c562 into nodejs:main Sep 12, 2026
89 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 312c562

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants