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

The shell-operator start command is not stopping when sent ^C. #186

Closed
GrahamDumpleton opened this issue Jul 5, 2020 · 2 comments
Closed

Comments

@GrahamDumpleton
Copy link

GrahamDumpleton commented Jul 5, 2020

With version of shell-operator from flant/shell-operator:v1.0.0-beta.10, but pulled out of that image into separate image where it is then being run from command line in the container, interrupting it with ``^C` is not resulting in it shutting down properly, even though it says it is gracefully shutting down.

The messages output are shown below, with you being able to see where ^C was generated:

time="2020-07-05T05:41:52Z" level=info msg="Hook executed successfully" binding=kubernetes hook=monitor-service-accounts.sh operator.component=taskRunner queue=main task=HookRun

^Ctime="2020-07-05T05:41:57Z" level=info msg="Grace shutdown by 'interrupt' signal"
time="2020-07-05T05:41:57Z" level=info msg=Stop operator.component=handleEvents

If you subsequently send ^C again, then forced shutdown works fine.

^Ctime="2020-07-05T05:42:12Z" level=info msg="Forced shutdown by 'interrupt' signal"

Using --log-level debug only results in the following extra details.

^Ctime="2020-07-05T05:47:50Z" level=info msg="Grace shutdown by 'interrupt' signal"
time="2020-07-05T05:47:50Z" level=info msg=Stop operator.component=handleEvents
time="2020-07-05T05:47:50Z" level=debug msg="queue main: got nil task, stop queue"

^Ctime="2020-07-05T05:47:57Z" level=info msg="Forced shutdown by 'interrupt' signal"
@diafour
Copy link
Contributor

diafour commented Jul 6, 2020

Hello! There was a problem with "Grace shutdown" mode: it stops a queue but not exits a process and continues to handle new Kubernetes events. There is a fix for this in PR #176. Now it stops handling Kubernetes events, Schedule events, stops all queues and exits immediately, or after 10 seconds if there is a running hook. It will be released in version beta.11 this week I think.

Root cause: https://github.com/flant/shell-operator/pull/176/files#diff-4cf792edf84af315656edde27d6291bfR43-R44

@diafour
Copy link
Contributor

diafour commented Jul 10, 2020

@shurup shurup closed this as completed Jan 15, 2021
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