sozu
sozu copied to clipboard
config command to close connections
this issue assembles #1, #5, and #67 and related info from #2.
There are cases where we would want to close manually a connection to a backend, like:
- we're closing the backend server, and some connections are still open
- there are too many long lived connections to one backend server
- we cannot stop a worker because it is still serving traffic
Here is the granularity to choose which connections to close:
- for one proxy ( a set of workers)
- for one worker
- for one app id
- for one frontend or backend: currently, we have no efficient way to get the list of clients linked to a frontend or backend
- for one specific connection: HTTP and HTTPS connection assign a UUID to each client connection, that id appears in the logs. We can use it to target a specific connection. TCP does not yet have a UUID per connection
For TCP, we can only stop the connection directly, but for HTTP, we can have a more graceful mode (along with the "hard" mode): stop a keepalive connection once it has been served completely. Issue: we need to insert a Connection: Close in the last response, and remember to close it afterwards, so there's some state to keep around.
it is already possible to insert the Connection: close header when we shutdown, but it is done for all the sessions, we could make that approach more granular