Skip to content

QuicTransportOptions.IdleTimeout vs KestrelServerLimits.KeepAliveTimeout #34955

@Tratcher

Description

@Tratcher

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);

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?

Metadata

Metadata

Assignees

Labels

HTTP3Needs: DesignThis issue requires design work before implementating.area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions