Skip to content

ackhandler: fix qlogging of outstanding packet count#5538

Merged
marten-seemann merged 1 commit into
masterfrom
ackhandler-fix-qlog-outstanding
Jan 11, 2026
Merged

ackhandler: fix qlogging of outstanding packet count#5538
marten-seemann merged 1 commit into
masterfrom
ackhandler-fix-qlog-outstanding

Conversation

@marten-seemann

@marten-seemann marten-seemann commented Jan 10, 2026

Copy link
Copy Markdown
Member

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).

@marten-seemann marten-seemann added this to the v0.59 milestone Jan 10, 2026
@macroscopeapp

macroscopeapp Bot commented Jan 10, 2026

Copy link
Copy Markdown

Fix qlog PacketsInFlight by updating ackhandler.sentPacketHandler.packetsInFlight to use sentPacketHistory.NumOutstanding() across app, handshake, and initial spaces

Switch packet-in-flight counting to outstanding packets and cache the computed value in ackhandler.sentPacketHandler.qlogMetricsUpdated; add sentPacketHistory.NumOutstanding() and expand tests to validate qlog metrics for ack-eliciting vs non-ack-eliciting packets.

📍Where to Start

Start with packetsInFlight and its usage in qlogMetricsUpdated in sent_packet_handler.go.


Macroscope summarized 6d32fa2.

@codecov

codecov Bot commented Jan 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.19%. Comparing base (76b3e07) to head (6d32fa2).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 use NumOutstanding() instead of Len() 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.

@marten-seemann marten-seemann force-pushed the ackhandler-fix-qlog-outstanding branch from 15d7203 to c38d19a Compare January 10, 2026 15:48
@marten-seemann marten-seemann force-pushed the ackhandler-fix-qlog-outstanding branch from c38d19a to 6d32fa2 Compare January 11, 2026 02:30
@marten-seemann marten-seemann merged commit bd4aea9 into master Jan 11, 2026
49 checks passed
@marten-seemann marten-seemann deleted the ackhandler-fix-qlog-outstanding branch January 11, 2026 02:39
wwqgtxx pushed a commit to MetaCubeX/quic-go that referenced this pull request Jan 11, 2026
wwqgtxx pushed a commit to MetaCubeX/quic-go that referenced this pull request Jan 11, 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.

2 participants