-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow connection pool to gradually drain down #55
Comments
This should also be considered at the Styx server level: the server should quite gracefully without losing existing requests. Many server applications and distributed environments (Kubernetes, OpenShift...) use the following approach, so we might want to support it natively:
With non-persistent connections this would mean not accepting new connections, but persistent(keep-alive) connections need to be handled differently, probably returning a Connection: close response. In the case of distributed environments, the SIGTERM signal is accompanied by taking the server out of rotation so that specific instance will stop receiving requests (those requests will go to other available servers so none will be rejected) . However, these systems cannot usually guarantee strict timing, so after receiving a SIGTERM the application could still receive new requests. Thus, if zero downtime is the goal, the SIGTERM is usually re-interpreted as 'start rejecting connections after a while', see this Kubernetes issue for details: kubernetes/ingress-nginx#322 We might decide to implement a 'distributed mode shutdown' that takes this use case into consideration, or just implement a normal shutdown process and expect the users to find environment-specific solutions (such as the preStop handler in Kubernetes) to avoid rejected connections.
|
Also consider draining down all connections when styx as a whole shuts? Is there another ticket for this? |
Closing all issues over 3 years old. New issues can be created if problems are still occurring. |
The problem
When an origin is removed from configuration, the associated connection pool is closed. The closure is rather abrupt as it closes each borrowed connection straight away:
Desired behaviour
Ideally, the connection pool should be drained down without affecting the ongoing connections.
When closed, the connection pool should go into a
draining
state where it stops accepting new connections, and waits until all borrowed connections are returned back to the pool. After which it then finally considered fully closed.That is, the signature of the close method should probably change:
Detailed description
See above.
Acceptance criteria
draining
state.The text was updated successfully, but these errors were encountered: