[release/6.0] [HTTP/3] Fix content stream read hang #58460
Merged
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.
Backport of #58296 to release/6.0
The fix is similar to PR #56892 but for another branch (when data is buffered). The root cause is the same - if there's still space in user's buffer we'd start waiting for the next data frame to arrive (which will not happen in echo scenario).
Current code (including #56892 change) may be inefficient in case of small data frames that may be already available in transport, but refactoring that is too large of a change if we consider backporting. I thought #56891 would cover that, but it's QUIC specific, while we also have HTTP/3 specific problem here. I will create another issue later.
Fixes #57888
/cc @CarnaViire
Customer Impact
Reading from an HTTP/3 Response Content stream with large buffer size (bigger than available data) can hang.
Conditions for hitting the hang:
Testing
Functional test added, other HTTP/3 tests passed.
Risk
Low, H/3 only code path (hidden behind AppContext switch).
Impact on H/3 is Low/Medium -- it touches on the way Content stream is read, but is something fairly well covered by existing tests and the change is small. The data will be handed over in smaller chunks.