-
Notifications
You must be signed in to change notification settings - Fork 174
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
Catch SIGTERM and SIGINT #556
Comments
Hi @Nudin and thanks for the issue. This use case is in part why the ara expire command exists: to eventually expire playbooks that crashed or were interrupted and thus remained in running forever. I like the idea of trying to capture signals if it is possible and you have something working. I wonder how reliable it would be because running from within the ansible callback plugin interface is kind of special but it is probably better than nothing. I also wonder about whether the status of the playbook should be failed, expired or if we need something new like "interrupted" because the playbook didn't /really/ fail. If you would like to open a PR with what you have we can discuss it and go from there. |
This will catch SIGINT/SIGTERM and send an update to the ara server, so that the playbook does not continue to be shown as running indefinitely but will report failed. See ansible-community#556
This will catch SIGINT/SIGTERM and send an update to the ara server, so that the playbook does not continue to be shown as running indefinitely but will report failed. See ansible-community#556 (cherry picked from commit 93fb6a5)
What is the idea ?
When an ansible deploy is stopped – by for example C^c, kill or a crash of the controller – ara will continue to show the run as "running" indefinitely or until
ara expire
is executed. For some kinds of crashes like SIGKILL or kernel panics this is unavoidable, but for the most common cases SIGINT (C^c) and SIGTERM it would be possible to catch the signal to gracefully mark the run as failed. This would improve the usefulness of ara, since one would see if a run is still ongoing or was canceled by the caller.I tried adding a signal trap to the ara ansible callback script and it works.
The text was updated successfully, but these errors were encountered: