Repository navigation
Serialize HTTP/2 loopback writes and join reader before disposal - #135941
Merged
Merged
Conversation
Enable existing connection-scoped I/O serialization for stream-limit and keepalive tests. Dispose keepalive connections after joining frame processing so EOF cleanup cannot race final response writes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3326d75e-588a-4534-9778-75e5812d65c0
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
This was referenced Oct 16, 2026
Closed
MihaZupan
approved these changes
Oct 17, 2026
Member
Author
|
/ba-g mutex tests are unrelated |
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.
HTTP/2 stream-limit and keepalive tests can issue concurrent writes on one loopback connection, causing
SslStreamto throwNotSupportedException: This method may not be called when another write operation is pending.A pendingReadFrameAsynccan send a transparent PING ACK while the test sends response HEADERS; the keepalive reader can also observe client EOF and send disposal GOAWAY while final response DATA is still being written.Enable the existing connection-scoped
EnsureThreadSafeIOoption for the stream-limit test and keepalive fixture. Move keepalive connection disposal toTerminateLoopbackConnectionAsync, after joining the incoming-frame task, so the reader does not independently initiate shutdown on EOF. Protocol assertions are unchanged; there are no product changes or changes to the shared helper implementation.Validation
Windows x64, using a short
substpath:.\build.cmd clr+libs -rc release: passed. Existing MsQuic package advisory warnings remain..\dotnet.cmd build src\libraries\System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj /t:Test /p:Outerloop=true "/p:XUnitOptions=-method System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_Http2.Http2_MaxConcurrentStreams_LimitEnforced -method System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2KeepAlivePing_Test.KeepAlivePingDelay_Infinite_NoKeepAlivePingIsSent -method System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2KeepAlivePing_Test.KeepAliveConfigured_KeepAlivePingsAreSentEvenWith0ConnectionLifetime -method System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2KeepAlivePing_Test.KeepAliveConfigured_ConnectionAtMaxConcurrentStreams_KeepAlivePingsAreStillSent -method System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2KeepAlivePing_Test.KeepAliveConfigured_HandlerDisposedWithActiveRequest_KeepAlivePingsAreStillSent": passed; repeated twice with/p:TestNoBuild=true, totaling 15 passed, 0 failed, 0 skipped after removing instrumentation..\dotnet.cmd build src\libraries\System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj /t:Test /p:Outerloop=true /p:TestNoBuild=true "/p:XUnitOptions=-class System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2KeepAlivePing_Test": passed, 10 tests, 0 skipped.Temporary connection-scoped tracing and a 50-ms delay of transport write completion below
SslStreamreproduced competing writers in four of the five methods. Across three repetitions of all five tests, the original code had 12 failures; serialization alone passed 15/15, joining alone passed 9/15, and this fix passed 15/15 under the same delay. Traces confirmed queued ACK writes reached TLS only after the preceding response write completed. All instrumentation and delay controls were removed from this patch.No spontaneous failure occurred in the unamplified baseline. The max-concurrent-streams keepalive variant did not reproduce locally, although it passed all fixed runs. Linux/ARM, NativeAOT, WinHTTP, and the full System.Net.Http suite were not run.
Note
This pull request description and code changes were generated with GitHub Copilot.