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

Support double signal handling #220

Closed
asymmetric opened this issue Mar 27, 2018 · 2 comments
Closed

Support double signal handling #220

asymmetric opened this issue Mar 27, 2018 · 2 comments

Comments

@asymmetric
Copy link
Contributor

See this.

This allows us to exit immediately if we receive two signals, in addition to exiting gracefully if we only receive one.

@krnowak
Copy link
Contributor

krnowak commented May 22, 2018

To reproduce, start the operator in terminal, outside the kubernetes cluster. And then press ctrl-c. Currently it prints something like "received SIGTERM, exiting gracefully", and what we want there [I guess :)] is to have ctrl-c to trigger the cancel function of the context, which in turn would make all the goroutines to quit, which would result in a graceful shut down of the operator (so it would print something like "context channel closed, exiting"). If something hangs, second ctrl-c would just shut down the operator right away.

For more context (sorry for the pun!) about the task see golang context package and our use of it

@krnowak
Copy link
Contributor

krnowak commented May 22, 2018

Other way of reproducing is basically to run the operator inside the cluster, figure out its PID and kill it with SIGTERM as this is what would normally happen to the process when, for example, cluster or operating system is shutting down. But I'd say that running it outside the cluster and terminating it with ctrl-c is tons simpler.

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

No branches or pull requests

3 participants