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

Are we listening to SIGTERM? We should! #1476

Closed
consideRatio opened this issue Nov 11, 2019 · 1 comment
Closed

Are we listening to SIGTERM? We should! #1476

consideRatio opened this issue Nov 11, 2019 · 1 comment

Comments

@consideRatio
Copy link
Member

consideRatio commented Nov 11, 2019

By default, a pod can have 30 seconds on it to shut down by first being asked kindly with SIGTERM on its containers, and then forcefully with SIGKILL.

It is very possible that our code running in a container will ignore SIGTERM and then get forcefully killed by SIGTERM after the terminationGracePeriodSeconds has passed. I think our proxy pod does this currently. With that said, I think the quick fix improvement is to reduce the terminationGracePeriodSeconds to zero as it will be an abrupt kill for the process anyhow. But better is if we can react to SIGTERM no process id #1! So, how do we do this?

Related reading:

@consideRatio consideRatio changed the title Are we listening to SIGTERM? Are we listening to SIGTERM? We should! Nov 11, 2019
@consideRatio
Copy link
Member Author

I've learned that docker stop will send a SIGTERM and then later a SIGKILL. Very similar to kubernetes, so we can check if a container is good or bad when it comes to this.

I'm closing this along with jupyterhub/configurable-http-proxy#217 is merged where we fixed the issue for the CHP container of the proxy pod. If the autohttps pod has this fix isn't confirmed to me, but they use dumb-init which is all about considering the signals etc so I figure they do care about that signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant