Skip to content

Synchronize HTTP/2 queue-time test with connection publication - #134423

Merged
rzikm merged 2 commits into
dotnet:mainfrom
rzikm:rzikm/http-queue-time-metrics-failures
Oct 13, 2026
Merged

rzikm merged 2 commits into
dotnet:mainfrom
rzikm:rzikm/http-queue-time-metrics-failures

Conversation

@rzikm

@rzikm rzikm commented Sep 22, 2026

Copy link
Copy Markdown
Member

The HTTP/2 TimeInQueue_RecordedForNewConnectionsOnly test assumes that completing the first response makes its connection immediately available to subsequent requests. The pool can signal the first waiter before publishing the connection, so later sequential requests can legitimately queue on that same connection and produce two or three measurements. Queue duration measures waiting for an available connection, not just connection establishment.

This test-only change waits for publication before testing reuse. A scoped private EventSource listener correlates the first request URI with its pool/connection identifiers and waits for that connection's publication, including when publication precedes request correlation. The callback does not block, and the wait has a timeout. The first measurement's duration and tags are checked, and the final expected count stays 1. Production behavior, metric tags, and HTTP/1.1 and HTTP/3 handling are unchanged.

The intentional maintenance dependency is on the private Sending request: and Put HTTP2 connection in pool. trace messages. Related to #122522; this does not claim to resolve its HTTP/3 reports or prove the schedule of every historical CI failure.

Validation

Windows x64, Debug libraries and Release runtime:

  • Baseline clr+libs build passed.
  • An artifact-only forced-scheduling probe reproduced Actual 2 and Actual 3 against the original test for both HttpClient and HttpMessageInvoker. The corrected test passed six controls covering delayed publication, publication before correlation, and unrelated-Meter isolation. The probe is not part of this PR.
  • All nine metrics fixtures: 298 passed, 2 expected skips.
  • Existing saturated HTTP/2 connection queue-telemetry control: 1 passed.
  • NativeAOT HTTP/2 metrics fixtures: 72 passed, 4 existing skips; both changed test variants passed.

Linux/musl was not run locally. No clean full-library result is claimed: an accidentally unfiltered NativeAOT invocation was stopped after failures outside the target fixtures; the final explicitly filtered invocation passed.

Note

This change and description were generated with GitHub Copilot.

Wait for the first request's connection to be published before testing immediate reuse. Preserve the single queue measurement assertion and validate its duration and tags without changing production metrics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

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

@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.

Replace private diagnostic synchronization with observed queue measurements. Preserve initial sample validation, reject duplicate warm-up samples, and accommodate warm-up requests on the same loopback connection.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@MihaZupan MihaZupan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@rzikm
rzikm merged commit 3f94356 into dotnet:main Oct 13, 2026
85 of 87 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 14, 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