Repository navigation
Isolate diagnostics request reuse from connection shutdown - #136912
Merged
Merged
Conversation
Use one loopback connection for the three handler sends while preserving all diagnostic header checks and response statuses. Observe client and server failures together so an early client error is not hidden behind the server timeout. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 11 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 |
MihaZupan
approved these changes
Nov 3, 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.
SendAsync_ReuseRequestInHandler_ResetsHeadersForEachReusechecks diagnostic header regeneration, but currently closes a connection after every send. This unnecessarily exercises HTTP/3 shutdown races. It also awaits all server exchanges before observing the client task, so an early client failure can be hidden behind a server timeout.Use one loopback connection for the three sends and the existing failure-aware
CreateClientAndServerAsyncorchestration. Preserve all original header assertions and the 500/500/200 response sequence, dispose the request and final response, and assert the final status.This is test isolation and failure-reporting hardening, not a confirmed fix for the Linux CI failure or an HTTP/3 pooling/retry-policy fix. The original test passed 1,000 natural HTTP/3 iterations locally on Windows. Injecting a client exception before the second send reproduced the masking defect: the original reported only a timeout after 72.440 seconds; the revised test exposed the injected exception in 0.735 seconds.
Validation
Windows x64, Debug libraries and Release CoreCLR, using the worktree's
H:shortcut:.\build.cmd clr+libs -rc release- passed, zero warnings/errors..\.dotnet\dotnet.exe build src\libraries\System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj /t:Test /p:RuntimeConfiguration=Release "/p:XUnitOptions=-method *.SendAsync_ReuseRequestInHandler_ResetsHeadersForEachReuse"- original passed all four variants; revised test passed 1,000 iterations per variant using a temporary local wrapper (4,000 iterations total).DiagnosticsHandler's reuse-state mark, after explicitly rebuilding the product library, failed all four variants at the retained header assertions as expected. All fault injection, mutation, and repetition wrappers were removed afterward, and the original Windows product library was rebuilt..\.dotnet\dotnet.exe build src\libraries\System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj /t:Test /p:RuntimeConfiguration=Release- final functional suite passed: 5,510 total, 0 failed, 48 skipped. All four request-reuse variants passed.Linux, browser, and WASI tests were not run. The underlying client exception behind the reported Linux CI timeout remains unproven.
Relates to #132085.
Note
This pull request description and code change were prepared with GitHub Copilot assistance.