You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
Nudin
added a commit
to Nudin/ara
that referenced
this issue
Jun 27, 2024
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
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: