[HTTP/3] Fix NullReferenceException on Timeout when streaming request body#59204
[HTTP/3] Fix NullReferenceException on Timeout when streaming request body#59204CarnaViire merged 5 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBrings the logic for canceling streaming request body from HTTP/2 to HTTP/3. The problem was that cancellation token was not applied to SendContentAsync, which resulted in Http3WriteStream not being disposed properly. Fixes #57619
|
ManickaP
left a comment
There was a problem hiding this comment.
Some questions about the test, but looks good, thanks!
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http3.cs
Outdated
Show resolved
Hide resolved
| // Send headers | ||
| await requestStream.FlushAsync(); | ||
|
|
||
| await requestStream.WriteAsync(message).AsTask().WaitAsync(TimeSpan.FromSeconds(10)); |
There was a problem hiding this comment.
How do we make sure that the 0.3 seconds timeout of HttpClient doesn't fire before this WriteAsync?
There was a problem hiding this comment.
Good catch. I don't think we can get to 100% sure with timeouts. But I will rework the test and increase the timeout. Will add a second test for an external cancellation token, which will induce the same logic but will also have consistent behavior.
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Outerloop test failures are unrelated. Most of them are |
#58355 ??? |
Brings the logic for canceling streaming request body from HTTP/2 to HTTP/3.
The problem was that cancellation token was not applied to SendContentAsync, which resulted in Http3WriteStream not being disposed properly.
Fixes #57619