ackhandler: fix qlogging of outstanding packet count#5538
Conversation
Fix qlog PacketsInFlight by updating
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5538 +/- ##
==========================================
+ Coverage 84.16% 84.19% +0.03%
==========================================
Files 159 159
Lines 16363 16366 +3
==========================================
+ Hits 13771 13779 +8
+ Misses 1957 1954 -3
+ Partials 635 633 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug in the qlogging of outstanding packet counts. Previously, all packets in the history were counted as "packets in flight," but the correct behavior is to only count ack-eliciting packets as outstanding, since non-ack-eliciting packets don't count towards bytes in flight.
Changes:
- Added
NumOutstanding()method to expose the count of outstanding packets - Updated
packetsInFlight()to useNumOutstanding()instead ofLen()to correctly exclude non-ack-eliciting packets - Added test coverage to verify outstanding packet counting
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/ackhandler/sent_packet_history.go | Added NumOutstanding() getter method to expose the internal outstanding packet count |
| internal/ackhandler/sent_packet_handler.go | Fixed packetsInFlight() to use NumOutstanding() instead of Len() and optimized qlogMetricsUpdated() to avoid duplicate calls |
| internal/ackhandler/sent_packet_history_test.go | Added test assertions to verify NumOutstanding() correctly counts only ack-eliciting packets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
15d7203 to
c38d19a
Compare
c38d19a to
6d32fa2
Compare
Non-ack-eliciting packets are not considered outstanding (and they don't count towards bytes in flight).
This is not yet the fix for the issue reported, but it does fix the incorrect qlog posted in #5535 (comment).