SwiftQUIC: Fix off-queue scheduled event - #151
Merged
Merged
Conversation
agnosticdev
requested review from
kkuk24,
rpaulo and
tfpauly
as code owners
September 16, 2026 15:44
rpaulo
approved these changes
Sep 16, 2026
tfpauly
requested changes
Sep 16, 2026
| updateOutboundFlowControlCredit(connection: connection) | ||
| if self.maximumStreamDataSize > 0 { | ||
| upper.deliverOutboundRoomAvailableEvent(reference) | ||
| fromExternal { |
Collaborator
There was a problem hiding this comment.
This is not the right approach here. This is implying that something was entering the stack without going through one of the correct calls earlier.
Collaborator
Author
There was a problem hiding this comment.
Moved to the instance async function as an alternative 7d5abc0
tfpauly
approved these changes
Sep 16, 2026
| asyncSendRunning = true | ||
| log.datapath("async: scheduling restart after packet burst") | ||
| self.context.async { | ||
| self.async { |
Collaborator
There was a problem hiding this comment.
This is the right fix, thanks! Can you also address the same issue in writeQLog?
kkuk24
approved these changes
Sep 16, 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.
This is a potential fix for an off-queue scheduled event that can land the upper stream harness in the wrong state. This was seen when testing with swift-nio-quic recently. For example:
The call to
resumeSendingAfterBurstLimit()is run asynchronous and then firesdeliverOutboundRoomAvailableEventon the back-side which ends up tripping the wrong stream it looks like.