Skip to content

Serialize and bound outgoing stream resets - #508

Open
idy wants to merge 1 commit into
pion:mainfrom
GizClaw:fix/serialize-stream-resets
Open

idy wants to merge 1 commit into
pion:mainfrom
GizClaw:fix/serialize-stream-resets

Conversation

@idy

@idy idy commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Closing several streams in a row sends one RECONFIG per stream before the previous one is answered. RFC 6525 section 5.1.1 allows only one request in flight; if the packets are reordered, the earlier request gets Bad Sequence Number and that stream is never reset. This queues resets, sends the next request after the outstanding one is answered, and caps a request at 128 stream IDs so it fits in one packet.

Split out of #494.

🤖 Generated with Claude Code

@idy
idy force-pushed the fix/serialize-stream-resets branch from 9dec012 to 2afccee Compare September 20, 2026 14:49
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.67%. Comparing base (b872f59) to head (1bdb2f5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
+ Coverage   85.52%   85.67%   +0.14%     
==========================================
  Files          56       56              
  Lines        5487     5493       +6     
==========================================
+ Hits         4693     4706      +13     
+ Misses        559      553       -6     
+ Partials      235      234       -1     
Flag Coverage Δ
go 85.67% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

RFC 6525 section 5.1.1 permits only one reconfiguration request in
flight. Stream.Close for several streams in a row sent one RECONFIG
per call, each with its own RSN, before the previous one was
answered. If the packets were reordered, the later request arrived
first and the earlier one was rejected with Bad Sequence Number, so
that stream was never reset.

Queue outgoing stream resets and send the next request only after the
outstanding one is answered. Cap a request at 128 stream identifiers
so the RECONFIG chunk fits in one packet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@idy
idy force-pushed the fix/serialize-stream-resets branch from 2afccee to 1bdb2f5 Compare September 21, 2026 18:34
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.

1 participant