Skip to content

Retransmit lost MAX_DATA frames with the latest connection limit - #100

Merged
ptrd merged 2 commits into
ptrd:masterfrom
DeveloperKubilay:connection-credit-recovery
Oct 23, 2026
Merged

ptrd merged 2 commits into
ptrd:masterfrom
DeveloperKubilay:connection-credit-recovery

Conversation

@DeveloperKubilay

@DeveloperKubilay DeveloperKubilay commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Connection flow-control updates currently use an empty loss callback. If the last MAX_DATA frame is lost and the sender exhausts its old credit, neither side necessarily has more data to consume or send to generate another update, leaving the transfer stalled.

Register a loss callback that retransmits the current connection limit. The callback reads the existing volatile limit without acquiring the update lock. Repeated losses retain the callback, and a lost older update advertises the latest credit rather than a stale limit.

Validation on current master (101c733d):

  • The regression sends two credit updates and invokes the first update's loss callback, checking that the retransmission advertises the latest limit. It fails on unmodified master and passes with this change.
  • All 51 StreamManagerTest tests pass with JDK 21 on Windows.
  • A combined core-suite run with the independent immediate-ACK fix passed 1167 tests, skipped one pre-existing disabled test and failed two IPv6/DNS tests. Both DNS failures reproduce on clean master on this machine.

This PR is independent of receive-window auto-tuning and does not change the configured buffer budget or library version.

Fork CI: the complete ./gradlew build passed on Linux / JDK 17 with the upstream workflow and no test exclusions: https://github.com/DeveloperKubilay/kwik/actions/runs/39651941690. Upstream PR checks remain separate.

Review follow-up: removed the unnecessary lock from the retransmission callback. All 51 StreamManagerTest tests pass again with JDK 21 on Windows.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 18:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

}

private void retransmitMaxData(QuicFrame lostFrame) {
updateFlowControlLock.lock();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think the lock is necessary here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right; I have made the necessary correction.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

@ptrd

ptrd commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Thanks. Surprised to see there was not retransmit function for this case; you're absolutely right that there ought to be one.

@ptrd
ptrd merged commit 8d7d6a6 into ptrd:master Oct 23, 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.

3 participants