-
Notifications
You must be signed in to change notification settings - Fork 151
fix(s2n-quic-transport): arm PTO timer after loss timer expires #1942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| //# threshold loss detection will expire earlier than the PTO timer in | ||
| //# most cases and is less likely to spuriously retransmit data. | ||
| self.pto.cancel(); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd be checking consistency in any of these return points. Maybe move the whole thing into a closure?
(|| {
// do logic here
})();
self.check_consistency();especially where we're cancelling the timer it's good to have a sanity check that the invariants still hold
| timer_required &= self.time_of_last_ack_eliciting_packet.is_some(); | ||
|
|
||
| if timer_required { | ||
| assert!(self.armed_timer_count() > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: might be easier to debug if you use assert_ne since that'll print the actual value
| assert!(self.armed_timer_count() > 0); | |
| assert_ne!(self.armed_timer_count(), 0); |
Description of changes:
QUIC-RECOVERY does not explicitly include a requirement that the Probe Timeout (PTO) timer is re-armed after the loss timer expires, but the pseudocode in QUIC-RECOVERY§A.9 does include this behavior:
Arming the PTO timer in this case is necessary, as the loss timer expiring will not necessarily cause any additional transmissions. There may still be tail packets pending; the PTO timer is needed to ensure those packets are accounted for and retransmitted as necessary. An example interop failure caused by this can be seen here
In addition, QUIC-RECOVERY§6.2.1 specifies that the acknowledgement of ack-eliciting packets should trigger a PTO update:
The pseudocode in QUIC-RECOVERY§A.7 does not make that distinction, however. This behavior is preferred, as detect_and_remove_lost_packets() will cancel the loss timer, and there may still be ack eliciting packets pending that require a PTO timer for recovery. I've removed the requirement that an acknowledged packet be ack-eliciting to more closely match the pseudocode.
Call-outs:
I refactored the max pto backoff a bit to make it easier to validate the consistency of the PTO timer within the recovery manager.
Testing:
New and updated unit tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.