Skip to content

ackhandler: only generate RTT sample for the last ack-eliciting packet#5493

Merged
marten-seemann merged 1 commit intomasterfrom
packet-buffering-rtt
Dec 21, 2025
Merged

ackhandler: only generate RTT sample for the last ack-eliciting packet#5493
marten-seemann merged 1 commit intomasterfrom
packet-buffering-rtt

Conversation

@marten-seemann
Copy link
Copy Markdown
Member

@marten-seemann marten-seemann commented Dec 20, 2025

Fixes #5474.

This logic now works across packet number spaces. It avoids inflated RTT measurements when packets are buffered during the handshake.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 20, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
2405 4 2401 7
View the top 3 failed test(s) by shortest run time
github.com/quic-go/quic-go/internal/ackhandler::TestSentPacketHandlerRTTAckDelays
Stack Traces | 0s run time
Failed
github.com/quic-go/quic-go/internal/ackhandler::TestSentPacketHandlerRTTAckDelays/1-RTT
Stack Traces | 0s run time
Failed
github.com/quic-go/quic-go/internal/ackhandler::TestSentPacketHandlerRTTAckDelays/Handshake
Stack Traces | 0s run time
Failed
github.com/quic-go/quic-go/internal/ackhandler::TestSentPacketHandlerRTTAckDelays/Initial
Stack Traces | 0s run time
Failed

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@marten-seemann marten-seemann force-pushed the packet-buffering-rtt branch 2 times, most recently from 51a4888 to 5da5779 Compare December 21, 2025 06:20
@marten-seemann marten-seemann marked this pull request as ready for review December 21, 2025 06:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the RTT sample generation logic in the ack handler to only generate RTT samples for the last ack-eliciting packet sent across all packet number spaces, addressing issue #5474.

Key Changes:

  • Added tracking of the send time of the last acknowledged ack-eliciting packet across packet number spaces
  • Modified RTT update logic to only generate samples when the acknowledged packet was sent at or after the previously acknowledged packet
  • Refactored test helper function contains0RTTPacket to the more general containsPacketType for reuse

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/ackhandler/sent_packet_handler.go Added largestAckedTime field to track chronologically last acknowledged packet; updated RTT calculation logic to only update when current packet's send time is >= last acked time
internal/ackhandler/sent_packet_handler_test.go Renamed existing RTT test for clarity; added new test to verify RTT behavior across packet number spaces (Initial and Handshake)
integrationtests/self/self_test.go Generalized contains0RTTPacket to containsPacketType to check for any packet type
integrationtests/self/zero_rtt_test.go Updated to use generalized containsPacketType function
integrationtests/self/http_test.go Updated to use generalized containsPacketType function
integrationtests/self/handshake_drop_test.go Added new integration test to verify packet buffering and RTT measurement during handshake with packet loss

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integrationtests/self/handshake_drop_test.go Outdated
Comment thread internal/ackhandler/sent_packet_handler.go
Comment thread integrationtests/self/self_test.go Outdated
This logic now works across packet number spaces.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marten-seemann marten-seemann merged commit 96b8144 into master Dec 21, 2025
58 of 59 checks passed
@marten-seemann marten-seemann deleted the packet-buffering-rtt branch December 29, 2025 14:35
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.

buffering of undecryptable packets can lead to inflated RTT measurements

2 participants