-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature: Termination Timeout option #112
Comments
Are you sure about "New connections can still be opened"? Right now the behavior is to close the listening socket at the first TERM, send Connection::Close frame to all client connections and wait indefinitely for them to close the sockets. On the second TERM all client sockets are forcefully closed. |
Hi @carlhoerberg, For our particular sidecar case, it would have been the desired behaviour. Since the proxy instance has no other client that is opening connections to it than the "main" container inside the Kubernetes However I can see that this might not be desireable in a setup where a proxy is used by multiple independent clients. For example in a separate Kubernetes |
Just checked the Kubernetes Service behavior when a Pod gets terminated. As far as I can see, it won't receive new traffic anymore. Regardless of the readiness probe status: https://kubernetes.io/docs/tutorials/services/pods-and-endpoint-termination-flow/ |
Ok, so might as well stop the listerner too then at first TERM, won't affect k8s users, but make a more logical behavior for others, right? |
btw, #108 is fixed, sorry for the long delay, should have been fixed way earlier... |
You mean stop accepting new connections? I guess it depends on the topology
|
Just tested a little and managed to get So this would be a nice feature for the case where AMQProxy is deployed as a separate component (e.g. Kubernetes |
@carlhoerberg Just upgraded to the newest version (2.0.1) and tested the shutdown behavior. I configured the new In our case, we still receive errors when the proxy is terminating. Would there be negative consequences when the client connections are only closed after the timeout has passed (after the sleep https://github.com/cloudamqp/amqproxy/blob/main/src/amqproxy.cr#L96)? |
A nice-to-have feature would be that it checks if all clients have closed their connections by themselves and terminates early if that is the case. Since there might be no connections around anymore before the |
A configuration option that adds a configurable wait time before the proxy is shutting down would be useful for use in Kubernetes environments.
Use Case
Our concrete case:
Kubernetes Pod
x
seconds, then Supervisor starts it againProblem
A new application version gets deployed. The old Pod is stopped and a new one is started.
When the old Pod is stopped, all containers of that Pod receive a
SIGTERM
signal:This could be avoided if the AMQProxy sidecar container waited long enough until the Supervisor container stopped.
Current solution/workaround
Using a
preStop
hook for the AMQProxy sidecar containerFeature
SIGTERM
signal and the option is configured, it waits forx
seconds before stopping--
Google's CloudSQL Proxy has something like this:
The text was updated successfully, but these errors were encountered: