Fix handshake hang when Finished arrives with retransmitted state#808
Merged
JoTurk merged 1 commit intopion:masterfrom Mar 5, 2026
Merged
Fix handshake hang when Finished arrives with retransmitted state#808JoTurk merged 1 commit intopion:masterfrom
JoTurk merged 1 commit intopion:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #808 +/- ##
==========================================
+ Coverage 82.43% 82.51% +0.08%
==========================================
Files 120 120
Lines 6775 6773 -2
==========================================
+ Hits 5585 5589 +4
+ Misses 777 774 -3
+ Partials 413 410 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a82f73 to
16dd15c
Compare
The retransmit flag is set per-datagram, not per-record. When a new Finished shares a datagram with retransmitted records, the handshaker skips parsing and hangs. Always parse; only suppress the backoff timer reset for retransmits (pion#758).
16dd15c to
0d9b7c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The retransmit flag is set per-datagram, not per-record:
conn.go#L818-L847.I ran into a production case where
Finishedsometimes shares a datagram with retransmitted records.In a scenario like this, the handshaker skips parsing, cannot finish the handshake and hungs indefinitely.
This PR aims to retain the backoff logic for retransmits (#758), while allowing an edge case like this to be parsed. The included test reproduces the issue.
Reference issue
Follow up to #758 and subsequent fixes.