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
We need to be able to detect in the exit-handler whether the workflow has been STOPped or not. Currently, this is not possible, since when the 'exit-handler' is invoked, the Workflow object's status structure is not yet finalized, the workflow's and last steps' states are still Running. The only way to know the final Workflow status is the {{workflow.status}} & {{workflow.failures}} variables that can be added as step parameters. However, there is currently no way to know the shutdown flag's value, that is normally available on a finished workflow at workflow.status.shutdown.
@alexec's initial suggestion was to detect the stop from workflow steps (by detecting SIGTERM signals, which we do), then make an output parameter based on that, which then is available to the exit-handler. However, that doesn't look like an ultimate solution as the step(s) doing this detection might fail to start for various reasons.
My suggestion is to make the shutdown field available to the 'exit-handler', similarly how the final status & list of failures.
Use Cases
The 'exit-handler' is typically used to react to the workflow's status as a final step, usually pushing a final state update of the workflow to various backend system(s). Since we support "STOP" as a user-action, we need to be able to show proper "CANCELLED" status for workflows that have been stopped.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered:
Hi @alexec@szab100 I have the same problem almost two years after this question, do you know if it's possible to detect in the exit-handler whether the workflow has been stopped or not?
Thanks for your time!
agilgur5
changed the title
Make 'shutdown: true / false' parameter available to exit-handler
Make shutdown parameter available to exit-handler
Mar 9, 2024
Summary
We need to be able to detect in the exit-handler whether the workflow has been STOPped or not. Currently, this is not possible, since when the 'exit-handler' is invoked, the Workflow object's
status
structure is not yet finalized, the workflow's and last steps' states are stillRunning
. The only way to know the final Workflow status is the{{workflow.status}}
&{{workflow.failures}}
variables that can be added as step parameters. However, there is currently no way to know theshutdown
flag's value, that is normally available on a finished workflow atworkflow.status.shutdown
.@alexec's initial suggestion was to detect the stop from workflow steps (by detecting SIGTERM signals, which we do), then make an output parameter based on that, which then is available to the exit-handler. However, that doesn't look like an ultimate solution as the step(s) doing this detection might fail to start for various reasons.
My suggestion is to make the shutdown field available to the 'exit-handler', similarly how the final status & list of failures.
Use Cases
The 'exit-handler' is typically used to react to the workflow's status as a final step, usually pushing a final state update of the workflow to various backend system(s). Since we support "STOP" as a user-action, we need to be able to show proper "CANCELLED" status for workflows that have been stopped.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: