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

Handle kill event #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dustinblackman
Copy link
Contributor

@dustinblackman dustinblackman commented Jun 17, 2016

Docker's kill event is emitted when docker stop ID is used. In a real world scenario where this becomes very useful is when load balancing between containers using nginx-proxy. If the application within the container is watching for SIGTERM, it can instead hold itself open for any specific amount of time to finish in progress connections. NGINX on the other hand will remove the container from it's configuration to prevent any new requests from coming in, but will still hold the in progress connections until they finish (or when the container gives up and shuts down).

Docker at the moment doesn't have a State variable to define when a container is in progress of shutting down. In this case I've added Killing to the State struct that's defaulted to false that only flips to true when the kill event is emitted. Then is handled when generating the file.

@dustinblackman
Copy link
Contributor Author

@jwilder Any comments on this one? :)

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.

2 participants