-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
These two settings appear to serve the same purpose at different layers. Consider how to remove QuicTransportOptions.IdleTimeout and get that value from KestrelServerLimits.KeepAliveTimeout during bind, probably as a feature.
public ValueTask<IMultiplexedConnectionListener> BindAsync(EndPoint endpoint, IFeatureCollection? features = null, CancellationToken cancellationToken = default) | |
{ | |
var sslServerAuthenticationOptions = features?.Get<SslServerAuthenticationOptions>(); | |
if (sslServerAuthenticationOptions == null) | |
{ | |
throw new InvalidOperationException("Couldn't find HTTPS configuration for QUIC transport."); | |
} | |
if (sslServerAuthenticationOptions.ServerCertificate == null) | |
{ | |
var message = $"{nameof(SslServerAuthenticationOptions)}.{nameof(SslServerAuthenticationOptions.ServerCertificate)} must be configured with a value."; | |
throw new InvalidOperationException(message); | |
} | |
var transport = new QuicConnectionListener(_options, _log, endpoint, sslServerAuthenticationOptions); |
aspnetcore/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs
Line 48 in fce1e38
quicListenerOptions.IdleTimeout = options.IdleTimeout; |
Problem: QuicTransportOptions.IdleTimeout causes connections to be dropped without sending the HTTP/3 GOAWAY. The GOAWAY is intended to mitigate race conditions when starting new streams. We also don't want the IdleTimeout to be different from KestrelServerLimits.KeepAliveTimeout.
Proposal:
- Remove QuicTransportOptions.IdleTimeout and disable the underlying QuicListenerOptions.IdleTimeout setting (MaxValue?). We're marking QuicTransportOptions as preview API so we can modify it without regards for back compat.
- Explicitly manage HTTP/3 connection lifetimes at the Kestrel layer using KeepAliveTimeout, the same way we do for to HTTP/1 and HTTP/2. Send GOAWAYs before closing connections.
Update:
Should maximum concurrent streams be exposed via Http3Limits and automatically set on QuicTransportOptions.MaxConcurrentStreams?