Skip to content

Keep stream ownership for delayed ACKs - #507

Merged
JoTurk merged 2 commits into
pion:mainfrom
GizClaw:fix/delayed-ack-stream-owner
Sep 18, 2026
Merged

JoTurk merged 2 commits into
pion:mainfrom
GizClaw:fix/delayed-ack-stream-owner

Conversation

@idy

@idy idy commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

When a stream is reset and its ID is reused before a delayed SACK for the old stream arrives, the acknowledged bytes are credited to the new stream and release buffered bytes it never sent. This records the sending stream on each DATA chunk and credits that stream.

Split out of #494.

🤖 Generated with Claude Code

@JoTurk

JoTurk commented Sep 16, 2026

Copy link
Copy Markdown
Member

thank you for breaking the PRs i'll get most of them reviewed tonight

@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.48%. Comparing base (a3dc162) to head (36e8b4b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #507   +/-   ##
=======================================
  Coverage   85.48%   85.48%           
=======================================
  Files          56       56           
  Lines        5484     5484           
=======================================
  Hits         4688     4688           
  Misses        560      560           
  Partials      236      236           
Flag Coverage Δ
go 85.48% <100.00%> (ø)

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.

@idy

idy commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, and thanks for not turning away AI-assisted contributions! 😄 The way I see it, I'm burning my own Fable 5.1 tokens to send fixes your way, so it's basically a roundabout donation to open source. Win-win!

processSelectiveAck summed acknowledged bytes per stream identifier and
looked the stream up by identifier afterwards. When a stream is reset
and its identifier is reused before a delayed SACK for the old stream
arrives, the bytes were credited to the new stream, releasing buffered
bytes it never sent.

Record the sending stream on each DATA chunk and credit the bytes to
that stream. A stream that has already been removed is skipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@idy
idy force-pushed the fix/delayed-ack-stream-owner branch from def4073 to 4ef4edf Compare September 16, 2026 15:48
@JoTurk

JoTurk commented Sep 18, 2026

Copy link
Copy Markdown
Member

Would love if these PRs reference which part of the spec they enforce or implement :)

@JoTurk

JoTurk commented Sep 18, 2026

Copy link
Copy Markdown
Member

@JoTurk JoTurk 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.

Thank you

@JoTurk
JoTurk merged commit cb39bd6 into pion:main Sep 18, 2026
18 checks passed
idy added a commit to GizClaw/pion-sctp that referenced this pull request Sep 20, 2026
Bring in upstream sctp cb39bd6, which includes ClientContext, the move
to transport/v5 and two fixes from this branch that upstream merged
(pion#495 duplicate INIT, pion#507 stream ownership for delayed ACKs).

Resolve the checkPartialReliabilityStatus conflict by keeping this
branch's per-chunk reliability policy, which survives the peer
resetting its outgoing stream, while adopting upstream's corrected
retransmission count (nSent > limit, RFC 7496 Sec 3.1).

Update this branch's own tests to transport/v5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@idy
idy deleted the fix/delayed-ack-stream-owner branch September 20, 2026 14:57
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.

2 participants