Skip to content

fix(http2): respect peer max concurrent streams#5135

Merged
mcollina merged 2 commits into
nodejs:mainfrom
trivikr:h2-max-concurrent-streams
Apr 30, 2026
Merged

fix(http2): respect peer max concurrent streams#5135
mcollina merged 2 commits into
nodejs:mainfrom
trivikr:h2-max-concurrent-streams

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented Apr 28, 2026

This relates to...

Fixes: #5134

Rationale

HTTP/2 remote settings update client[kMaxConcurrentStreams], but dispatch was only throttled by pipelining.

When pipelining was higher than the server's advertised stream limit, Undici could open too many concurrent streams and receive NGHTTP2_REFUSED_STREAM.

Changes

  • Queue HTTP/2 requests while remote SETTINGS have not arrived and one stream is already running.
  • Queue HTTP/2 requests when the number of running streams reaches client[kMaxConcurrentStreams].

Features

N/A

Bug Fixes

Respect http/2 peer max concurrent streams

Breaking Changes and Deprecations

N/A

Status

Assisted-by: openai:gpt-5.5

Assisted-by: openai:gpt-5.5
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (aeed21a) to head (73325dd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5135   +/-   ##
=======================================
  Coverage   93.15%   93.16%           
=======================================
  Files         110      110           
  Lines       36212    36220    +8     
=======================================
+ Hits        33735    33743    +8     
  Misses       2477     2477           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 1ca84b1 into nodejs:main Apr 30, 2026
35 checks passed
@trivikr trivikr deleted the h2-max-concurrent-streams branch May 1, 2026 00:29
@github-actions github-actions Bot mentioned this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP/2 dispatch can exceed the server's advertised SETTINGS_MAX_CONCURRENT_STREAMS

3 participants