Don't set DATA send flag for zero-length send requests - #6248
Open
Tanishq Sharma (Tani-shar) wants to merge 3 commits into
Open
Don't set DATA send flag for zero-length send requests#6248Tanishq Sharma (Tani-shar) wants to merge 3 commits into
Tanishq Sharma (Tani-shar) wants to merge 3 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6248 +/- ##
==========================================
- Coverage 85.28% 84.94% -0.34%
==========================================
Files 60 60
Lines 18973 18977 +4
==========================================
- Hits 16181 16120 -61
- Misses 2792 2857 +65 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #6243.
The change: skip QuicSendSetStreamSendFlag(..., QUIC_STREAM_SEND_FLAG_DATA, ...) in QuicStreamSendFlush when SendRequest->TotalLength == 0.
Why this option over the other two in the issue: clearing DATA when a flush finds nothing sendable would also fire when the peer hasn't allowed the stream or when flow control blocks it, QuicStreamSendCanWriteDataFrames treats those as separate branches from "no unsent data" , so that fix would wedge streams a different way. Rejecting zero-length sends outright changes public API behavior.
FIN is unaffected: QuicStreamSendShutdown sets QUIC_STREAM_SEND_FLAG_FIN directly on the graceful path, so a zero-length send with FIN still works.
Verified: repro from the issue reproduces on 4984c21 (2.7.0), PASS after the fix, SKIP_EMPTY_SEND=1 still PASS, and SEND_COMPLETE still fires for the zero-length request.
Update: added a regression test and a second guard.
Guard 1 (above) skips setting DATA for zero-length requests in
QuicStreamSendFlush.Guard 2 clears a stale DATA flag in the stream write path when the flag is
set but
QuicStreamHasPendingStreamDatareturns false. This is the thirdoption from the issue, but keyed on
QuicStreamHasPendingStreamDataratherthan
QuicStreamSendCanWriteDataFrames— the former compares send offsetsonly, so it doesn't fire when data is pending but blocked by flow control or
by the peer not yet allowing the stream. That's the concern raised in point 2
above.
Regression test
Misc.StreamZeroLengthSendfails on main at 4984c21 andpasses with the fix. Each guard breaks the wedge independently, verified by
disabling one at a time.