-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Right now, we emit very short telemetry / activity "wait for connection" for every H/3 request, even if the request is immediately handled by the connection and doesn't wait. Follow queueStartingTimestamp
in:
Line 87 in 9b09bcf
long queueStartingTimestamp = HttpTelemetry.Log.IsEnabled() || Settings._metrics!.RequestsQueueDuration.Enabled ? Stopwatch.GetTimestamp() : 0; |
We shouldn't emit those events (if the connection can handle the request immediately). We do have _availableRequestStreamsCount
in H3 connection which we could use:
runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs
Line 56 in 9b09bcf
private int _availableRequestStreamsCount; |
Also, right now the code differs from H/2 pool because of the internal waiting in S.N.Quic OpenOutboundStreamAsync
.
Line 91 in 9b09bcf
connection = await http3ConnectionWaiter.WaitWithCancellationAsync(cancellationToken).ConfigureAwait(false); |
vs
Line 459 in 9b09bcf
connection = await http2ConnectionWaiter.WaitForConnectionAsync(request, this, async, cancellationToken).ConfigureAwait(false); |
So if we can bring the code closer to H/2 with this change, it would be an added bonus.
Original discussion: #103922 (comment)