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

Restarting Docker containers doesn't specify timeout, resulting in quick SIGKILL #3230

Closed
AHelper opened this Issue Nov 24, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@AHelper
Contributor

AHelper commented Nov 24, 2015

Been dealing with data lost/corruption from containers not being allowed to cleanly shut down when being restarted.

From docker restart documentation, the default timeout if not specified is 10 seconds (same with docker stop). Stopping a container defaults to 10 seconds in cockpit, but restart doesn't specify a timeout, which causes docker to nearly instantly force a restart with SIGKILL:

Nov 24 17:34:58 host1 docker[1422]: time="2015-11-24T17:34:58.706261844-06:00" level=info msg="POST /v1.12/containers/417d490561a5b6d336d29c3df6061813a83084c6cf32ebbd9984979495f44e10/restart"
Nov 24 17:34:58 host1 docker[1422]: time="2015-11-24T17:34:58.706651337-06:00" level=info msg="Container 417d490561a5b6d336d29c3df6061813a83084c6cf32ebbd9984979495f44e10 failed to exit within 0 seconds of SIGTERM - using the force"

@stefwalter stefwalter added the starter label Nov 25, 2015

@stefwalter

This comment has been minimized.

Show comment
Hide comment
@stefwalter

stefwalter Nov 25, 2015

Contributor

Nice catch. Are you interested in providing a patch for this? If so you probably would make the restart call more like the create call in the next function.

Contributor

stefwalter commented Nov 25, 2015

Nice catch. Are you interested in providing a patch for this? If so you probably would make the restart call more like the create call in the next function.

@AHelper

This comment has been minimized.

Show comment
Hide comment
@AHelper

AHelper Nov 25, 2015

Contributor

I am, I was planning on building from source and making a patch the next day. Should I go ahead and have restart accept a timeout, using default if not provided, like with stop? (I didn't see stop being invoked with a timeout, but hey, that functionality could be added in the future)

Contributor

AHelper commented Nov 25, 2015

I am, I was planning on building from source and making a patch the next day. Should I go ahead and have restart accept a timeout, using default if not provided, like with stop? (I didn't see stop being invoked with a timeout, but hey, that functionality could be added in the future)

@stefwalter

This comment has been minimized.

Show comment
Hide comment
@stefwalter

stefwalter Nov 25, 2015

Contributor

Yes, that would be great. Agree that it would be good to invoke both stop and restart with a timeout.The docker manual page seems to say 10 seconds is a good default, right?

Contributor

stefwalter commented Nov 25, 2015

Yes, that would be great. Agree that it would be good to invoke both stop and restart with a timeout.The docker manual page seems to say 10 seconds is a good default, right?

@AHelper

This comment has been minimized.

Show comment
Hide comment
@AHelper

AHelper Nov 26, 2015

Contributor

Correct, 10 seconds seem to work.

Contributor

AHelper commented Nov 26, 2015

Correct, 10 seconds seem to work.

@dperpeet dperpeet closed this in 418e493 Nov 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment