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

Fix race causing autorestart turning off on restart #17629

Merged
merged 1 commit into from Nov 3, 2015

Conversation

tonistiigi
Copy link
Member

When application takes a long time to handle SIGTERM there can be a race between application closing by itself and docker calling container.Kill(). If application closes first, Kill() will error because container is already stopped. This will also mean that docker restart will error after container is stopped and restart policies will not try to restart it.

cc @crosbymichael @andrewnguyen

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

@cpuguy83
Copy link
Member

cpuguy83 commented Nov 3, 2015

Does it need to be an Error log?
Warn or maybe even debug seem ok... might even be ignorable... as your comment says we don't care which function stopped it, just that it's stopped.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

@cpuguy83 Changed to warn. Its good to log this because its very unlikely to appear, meaning if you see this in the logs you had some quite weird containers running.

@cpuguy83
Copy link
Member

cpuguy83 commented Nov 3, 2015

LGTM

1 similar comment
@calavera
Copy link
Contributor

calavera commented Nov 3, 2015

LGTM

calavera added a commit that referenced this pull request Nov 3, 2015
Fix race causing autorestart turning off on restart
@calavera calavera merged commit 8d56954 into moby:master Nov 3, 2015
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.

None yet

4 participants