Skip to content

Stabilize HTTP/2 stream pooling test - #70281

Merged
DeagleGross merged 2 commits into
mainfrom
flaky/52573-http2-stream-pooling
Nov 10, 2026
Merged

DeagleGross merged 2 commits into
mainfrom
flaky/52573-http2-stream-pooling

Conversation

@BrennanConroy

@BrennanConroy BrennanConroy commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Stabilize HTTP/2 stream pooling test

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Synchronize the HTTP/2 stream pooling assertion

Description

The client can receive the first response before Kestrel's asynchronous request teardown returns its HTTP/2 stream to the pool. The second request can then allocate a different stream, causing the intentional reference-reuse assertions to fail even though pooling is working.

Add a trace event when an HTTP/2 stream enters the pool and wait for that event before sending the second request, matching the existing HTTP/3 synchronization. The quarantine and Assert.Same checks remain unchanged.

Issue: #52573

🤖 Posted by Flaky (AI Agent)

Wait for the HTTP/2 stream to return to the server pool before sending the second request, matching the existing HTTP/3 synchronization and preserving the reference reuse assertions.

Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Nov 4, 2026
@BrennanConroy
BrennanConroy marked this pull request as ready for review November 4, 2026 19:00
Copilot AI balanced review requested due to automatic review settings November 4, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The HTTP/2 pooling wait can miss a valid event during its unchecked final delay, causing spurious test failures; it needs to poll and recheck through the normal test timeout.

1 open issue
What changed in this PR

This PR addresses the HTTP/2 pooling race behind #52573 by waiting for server-side pooling before sending the second request.

Changes:

  • Add an HTTP/2 trace event after a stream enters the reuse pool.
  • Wait for the protocol-specific pooling event, preserving the existing HTTP/3 synchronization, quarantine, and reference-reuse assertions.
File Description
src/​Servers/​Kestrel/​test/​Interop.FunctionalTests/​Http3/​Http3RequestTests.cs Extend the pooling wait to HTTP/2.
src/​Servers/​Kestrel/​Core/​src/​Internal/​Infrastructure/​KestrelTrace.Http2.cs Define the Http2StreamPooled trace event.
src/​Servers/​Kestrel/​Core/​src/​Internal/​Http2/​Http2Connection.cs Emit the event after adding a stream to the pool.

Review effort: Balanced

@PureWeen

PureWeen commented Nov 4, 2026

Copy link
Copy Markdown
Member

/review

Copy link
Copy Markdown
Member Author

/azp run aspnetcore-components-e2e

🤖 Posted by Flaky (AI Agent)

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@PureWeen

PureWeen commented Nov 6, 2026

Copy link
Copy Markdown
Member

/review

@DeagleGross
DeagleGross enabled auto-merge (squash) November 10, 2026 10:06
@DeagleGross
DeagleGross merged commit 51ed718 into main Nov 10, 2026
30 checks passed
@DeagleGross
DeagleGross deleted the flaky/52573-http2-stream-pooling branch November 10, 2026 11:08
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 3%

No docs needed: the PR stabilizes a flaky test and adds an internal Kestrel trace event.

Documentation surfaces considered

  • Conceptual article: Not required — Internal trace event and test synchronization; no public API or user-visible behavior change.
  • Migration guidance: Not required — No upgrade action for users.
  • Breaking change: Not required — No compatibility impact.

wtgodbe added a commit that referenced this pull request Nov 11, 2026
Backport of #70281.

(cherry picked from commit 51ed718)

Co-authored-by: Brennan <[email protected]>
Co-authored-by: BrennanConroy <[email protected]>
Co-authored-by: Copilot <[email protected]>
wtgodbe added a commit that referenced this pull request Nov 11, 2026
Backport of #70281.

(cherry picked from commit 51ed718)

Co-authored-by: Brennan <[email protected]>
Co-authored-by: BrennanConroy <[email protected]>
Co-authored-by: Copilot <[email protected]>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 12, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 9b769522 Deployed Nov 10, 2026 by DeagleGross via conclusion #267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants