Repository navigation
XMC finalmask: Prevent deadlock during bidirectional startup padding - #7430
Merged
Merged
Conversation
Contributor
|
绷不住了 |
Contributor
|
确实难绷,我这边等下吧。 |
Contributor
还有那个部分padding被之前#7402加入的压缩压没的问题,又得等#7423 |
Contributor
这个怪我,我没仔细查 |
Contributor
|
我可不希望等会出现 PR A 等PR B |
Member
|
|
RPRX
pushed a commit
that referenced
this pull request
Nov 18, 2026
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.
XMC startup padding can deadlock after #7402 when both directions exceed the connection buffers. Both endpoints write their entire local schedule before starting the packet reader, so neither drains the peer's padding and both writes eventually time out.
Drain incoming
xmc:padpackets while sending startup padding. Retain the first non-padding packet and then hand reading back to the packet stream, buffering at most one packet. The padding wire format and configured pauses are preserved. A startup write failure closes the connection to release the pending reader.For example, this valid schedule can stall both endpoints:
The regression test exercises the full encrypted handshake over
net.Pipewith 64 KiB turns and TCP with 8 MiB turns and constrained socket buffers, followed by proxy data in both directions. The pipe handshake failed on both endpoints before the fix. Reader tests cover preserving following packets, read errors, empty reads, and connection closure.Checked the 57 currently open PRs: only #7423 and #7416 modify XMC. #7423 handles schedule bounds/cancellation and #7416 handles authentication; neither adds concurrent padding reads.
Validation passed: