-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
We have this optimization in the connection pool manager where we'll avoid storing connections that have the lifetime set to 0.
Lines 65 to 75 in f0f1457
// As an optimization, we can sometimes avoid the overheads associated with | |
// storing connections. This is possible when we would immediately terminate | |
// connections anyway due to either the idle timeout or the lifetime being | |
// set to zero, as in that case the timeout effectively immediately expires. | |
// However, we can only do such optimizations if we're not also tracking | |
// connections per server, as we use data in the associated data structures | |
// to do that tracking. | |
bool avoidStoringConnections = | |
settings._maxConnectionsPerServer == int.MaxValue && | |
(settings._pooledConnectionIdleTimeout == TimeSpan.Zero || | |
settings._pooledConnectionLifetime == TimeSpan.Zero); |
This also controls whether we create the heartbeat timer, which does the HTTP/2 ping sending and timeout enforcement.
Since we don't account for KeepAlivePingDelay
being set, a config that sets Lifetime/Timeout to 0 will also ignore the ping options.
Technically a bug, but the use cases where you'd care about this are likely very niche.
Copilot