Skip to content

Isolate diagnostics request reuse from connection shutdown - #136912

Merged
rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/http3-request-reuse-timeout-6d9
Nov 4, 2026
Merged

rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/http3-request-reuse-timeout-6d9

Conversation

@rzikm

@rzikm rzikm commented Nov 3, 2026

Copy link
Copy Markdown
Member

SendAsync_ReuseRequestInHandler_ResetsHeadersForEachReuse checks 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 CreateClientAndServerAsync orchestration. 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).
  • The same filtered command with a temporary omission of 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.

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

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@rzikm
rzikm merged commit 5a24b8c into dotnet:main Nov 4, 2026
23 of 24 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants