Conversation
Make sure to requeue a datagram and let the caller know that it could not be sent. An example of this is when a pending ack has consumed space before the datagram.
holleman
requested review from
agnosticdev,
kkuk24,
rpaulo and
tfpauly
as code owners
September 18, 2026 21:21
agnosticdev
reviewed
Sep 18, 2026
| connection.log.datapath( | ||
| "datagram for flow \(firstFlowID.debugDescription) does not fit \(roomBeforeWriting) free bytes; requeueing" | ||
| ) | ||
| datagrams.prepend(frame: datagramFrame) |
Collaborator
There was a problem hiding this comment.
Okay, so here we just add the frame back in and frame array and that way pending items knows to build a packet here for that flow again, correct?
Contributor
Author
There was a problem hiding this comment.
Yes, redo it. If it was a pending ack it would have gone out and then when we return we can pick up an empty packet and then send the datagram.
Collaborator
There was a problem hiding this comment.
In general, this seems like a good idea to not drop locally -- but does this cause a case where not being able to send a particular datagram to be at the front of the list forever and if it is too big to fit, no other datagrams can send?
rpaulo
reviewed
Sep 18, 2026
| connection.log.error("Unable to write datagram for flow \(firstFlowID)") | ||
| // Requeue rather than finalize and pass up the error so a retry is possible | ||
| connection.log.datapath( | ||
| "datagram for flow \(firstFlowID.debugDescription) does not fit \(roomBeforeWriting) free bytes; requeueing" |
Contributor
There was a problem hiding this comment.
Suggested change
| "datagram for flow \(firstFlowID.debugDescription) does not fit \(roomBeforeWriting) free bytes; requeueing" | |
| "Datagram for flow \(firstFlowID.debugDescription) does not fit \(roomBeforeWriting) free bytes; requeueing" |
A datagram too big for the flow should be dropped and prevent any head-of-line blocking. That works, but add a test to ensure that as well.
tfpauly
approved these changes
Sep 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.
Make sure to requeue a datagram and let the caller know that it could not be sent. An example of this is when a pending ack has consumed space before the datagram.