Skip to content

Go operator doesn't shutdown gracefully on SIGTERM #1843

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

Closed
ghost opened this issue Aug 20, 2019 · 3 comments
Closed

Go operator doesn't shutdown gracefully on SIGTERM #1843

ghost opened this issue Aug 20, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 20, 2019

Bug Report

The operator terminates immediately on SIGTERM
What did you do?
Start the built operator and press CTRL+C

What did you expect to see?
The operator wait for all reconcile loops to finish and then exit

What did you see instead? Under which circumstances?
The operators exits immediately interrupting the ongoing reconciles which leaves my kubernetes cluster in a dangling state.

Environment

  • operator-sdk version:
    0.9.0
@theishshah
Copy link
Member

That is the expected behaviour for SIGINT (Control + C). SIGTERM and SIGINT are generally not handled by the operator and are expected to exit without clean up.

@joelanford
Copy link
Member

Actually, I think this is supposed to be handled by controller-runtime's signal handler (which SDK uses), but there's a bug that causes the manager to return before the Runnables have stopped.

See kubernetes-sigs/controller-runtime#350

We'll pick this fix up when it makes it into a controller-runtime release.

@RobEarl
Copy link

RobEarl commented Aug 24, 2020

Does kubernetes-sigs/controller-runtime#967 allow this to progress?

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

3 participants