ackhandler: fix counting of packets queued for PTO probing#5539
Conversation
When an old packet is queued for retransmission to be able to send a PTO probe packet, it needs to removed from the outstanding packet count.
Fix counting of PTO probe-queued packets by declaring loss before removing bytes-in-flight in
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5539 +/- ##
==========================================
- Coverage 84.17% 84.15% -0.02%
==========================================
Files 159 159
Lines 16366 16366
==========================================
- Hits 13776 13772 -4
- Misses 1956 1959 +3
- Partials 634 635 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the packet counting logic when queuing packets for PTO (Probe Timeout) retransmission. The issue was that when an old packet is queued for retransmission to send a PTO probe, it wasn't being properly removed from the outstanding packet count.
Changes:
- Reordered operations in
QueueProbePacketto callDeclareLostbeforequeueFramesForRetransmission - Added a comment explaining why the order matters (DeclareLost must be called before queueFramesForRetransmission clears the frames)
- Enhanced test coverage to verify that the loss detection timer is properly cancelled when all packets are acknowledged
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/ackhandler/sent_packet_handler.go | Reordered method calls in QueueProbePacket to fix outstanding packet count tracking by calling DeclareLost before queueFramesForRetransmission |
| internal/ackhandler/sent_packet_handler_test.go | Added test assertions to verify loss detection timer cancellation when all packets are acknowledged, and fixed comment capitalization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When an old packet is queued for retransmission to be able to send a PTO probe packet, it needs to removed from the outstanding packet count.
(quic-go#5539) When an old packet is queued for retransmission to be able to send a PTO probe packet, it needs to removed from the outstanding packet count.
(quic-go#5539) When an old packet is queued for retransmission to be able to send a PTO probe packet, it needs to removed from the outstanding packet count.
When an old packet is queued for retransmission to be able to send a PTO probe packet, it needs to removed from the outstanding packet count.