-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Hello. We're trying to terminate downstream http2 connections periodically using max_connection_duration. The goal is, for long-lived streaming requests, to have clients select a new upstream host after max_connection_duration has elapsed, and therefore balance new and existing client connections as the backing application scales out.
After some testing, I've noticed that when there are active streams, the connection does not terminate and instead sits in draining-closing state indefinitely until the streams finishes or idle timeout.
For busy streaming requests which never end, this leaves a lingering connection. I expect streams to get reset after the drain sequence and fully close when max_connection_duration is reached.
Looking at the http conn manager, it appears that calling resetAllStreams() after the drain sequence should work. An alternative idea would be to add a configurable upper bound to stream duration.
We'd be happy to work on a PR for this, and would welcome some input on the preferred approach.