← Back to Pull requests

quic: create streams synchronously #67749

Closed
unknown closed this pull request without merging on Nov 26, 2026 13:41 UTC
View on GitHub
unknown unknown commented on Nov 24, 2026 13:30 UTC
Author

The QUIC API stream creation methods are async and return promises, but they never wait for anything. Discussed briefly in https://github.com/nodejs/node/pull/65331#issuecomment-5560302465.

The only situation where there's some actual async work anywhere is pending streams (blocked on flow control, or incomplete initial handshake). In that case we do return immediately today (promise resolves immediately) but just with stream.pending set to true.

That is correct imo: we do want to return immediately, because we want to allow queueing operations immediately without waiting for the stream to actually open, e.g. so you can start queueing up requests on streams straight away, without separately waiting for the handshake to complete.

In the case where you really want to wait for the stream to open before you use it, you just create the stream then use await stream.opened. This already works today.

Making this API async when it doesn't actually wait is confusing (suggests await will actually wait for opened somehow). It also adds an unnecessary promise & microtask for every stream, and similarly forces the calling code to be async, etc.

This PR drops that:

Drop async from the methods.
Remove unnecessary await from a large number of existing calls.
Updates waitUntilAvailable text, which implied the promise would wait for flow control (it didn't - it returns as pending).
Fix the swapped values for pending/now in the createStream debug message.

  • Documents the existing stream.pending
  • The alternative to all this is to make stream creation actually wait (at least in some cases). I don't see much upside though, and this approach roughly matches node:http2.

    Diff: 213 lines (+159 / -54) across 2 files Reviewer: efekrskl Review duration: 2890m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 213 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.321
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #67749"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.4% · Safe to merge
    14.4%
    Repository