Skip to content
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

Terminate gracefully after receiving a SIGTERM signal. #212

Closed
wants to merge 1 commit into from

Conversation

jbrook
Copy link

@jbrook jbrook commented Sep 25, 2018

See #128

Added a SIGTERM handler to the client with a configurable termination grace period (default 20s). During this period the client will refuse new connections. At the end of the period the process will exit. This allows in-flight database operations to complete when running as a sidecar container in Kubernetes and performing rolling updates.

Added a SIGTERM handler to the client with a configurable
termination grace period (default 20s). During this period
the client will refuse new connections. At the end of the
period the process will exit. This allows in-flight
database operations to complete when running as a sidecar
container in Kubernetes and performing rolling updates.
@jacobat
Copy link

jacobat commented Sep 25, 2018

This doesn't fully solve the issue AFAICT since other containers might try to establish connections even after being asked to terminate. An example chain of events: Web request hits application server -> pod is asked to terminate -> proxy receives sigterm -> application server tries to establish db connection resulting in error since the connection can't be established.

@kurtisvg
Copy link
Contributor

This feature is currently being developed in #206. If there is something about that implementation that doesn't cover your use-case, please let us know in either in #128 or in #206.

@kurtisvg kurtisvg closed this Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants