Skip to content

Track sent packets before immediate acknowledgements can arrive - #99

Open
DeveloperKubilay wants to merge 1 commit into
ptrd:masterfrom
DeveloperKubilay:immediate-ack-tracking
Open

DeveloperKubilay wants to merge 1 commit into
ptrd:masterfrom
DeveloperKubilay:immediate-ack-tracking

Conversation

@DeveloperKubilay

@DeveloperKubilay DeveloperKubilay commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A peer can acknowledge a datagram before SocketManager.send returns, especially on loopback or with a custom socket transport. Recovery currently records the packet after that call, so the ACK can be processed before the packet is known and leave acknowledged bytes counted as in flight.

Register recovery and idle-timer state immediately before sending, using the sender's clock. Successful-send statistics still advance after the send call.

Validation on current master (101c733d):

  • The new deterministic regression processes an ACK synchronously from the socket-send callback. It fails on unmodified master with 1127 bytes left in flight and passes with this change.
  • All 11 SenderImplTest tests pass with JDK 21 on Windows.
  • A combined core-suite run with the independent connection-credit 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.

No version, publishing or congestion-control changes are included.

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/39651941641. Upstream PR checks remain separate.

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.

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