Repository navigation
fix(pool): release saturated h2 protocol probes after SETTINGS - #6170
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6170 +/- ##
=======================================
Coverage 91.67% 91.67%
=======================================
Files 113 113
Lines 44419 44443 +24
=======================================
+ Hits 40721 40744 +23
- Misses 3698 3699 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EpicHigh
marked this pull request as ready for review
November 6, 2026 03:37
Merged
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to...
When an HTTP/2 peer advertises
SETTINGS_MAX_CONCURRENT_STREAMS = 1, a fresh Pool can leave its second request queued for as long as the first response stays open, even though another connection is allowed. This happens both during negotiation and after the first response headers arrive.Related to the protocol gate introduced in #5799. This is distinct from #6142: the probe connects successfully here, and its first request remains active rather than failing request validation.
Rationale
The h2 probe currently waits for its Client to emit
drain. A long-lived stream can consume the peer's entire stream allowance, preventing that event. Meanwhile the outstanding probe prevents the Pool from selecting a new connection.Changes
drainprematurely. Factory failures during queue draining reject only the affected request and preserve its async context without replaying accepted work. A synchronous retry from an error callback retains backpressure until capacity is available.No public API changes.
Status
Without the probe-release fix, the four saturation cases time out after 5 seconds on Node 24.22.1. On the initial PR head, both single-connection backpressure cases fail because
drainfires while the only stream is still occupied. With the current fix:Node 24.22.1:
npm run test:h2— 163 core and 14 fetch tests passed.Node 24.22.1: full unit suite — 1,678 passed, 3 skipped, 0 failed; BalancedPool — 25 passed.
Bun 1.4.4: all sixteen regressions passed.
npm run lintandgit diff --checkpassed.Existing cold-burst multiplexing, h1 fallback and single-connection tests pass.
I have read and agreed to the Developer's Certificate of Origin
Tested
Benchmarked (optional; not run)
Documented (no API/documentation change)
Review ready
In review
Merge ready