Flyte does not have a built-in exit handler mechanism for tasks or workflows. However, Flyte handles task failures and exits via error files and exit codes. When a task fails, Flyte attempts to write an error file and returns a non-zero exit code if the error file write fails. This behavior ensures that important information about the failure is not suppressed (
source).
For handling cleanup actions upon task termination, Flytekit does not currently support a termination hook directly. However, there have been discussions and feature requests for such a capability to allow custom cleanup actions when a task or workflow is aborted (
source).
Would you like more details on any specific aspect?
Sources:
-
https://github.com/flyteorg/flyte/pull/5444
-
https://github.com/flyteorg/flyte/issues/2810 👍 1 button 👎 0 button 💡
Hint: Mention
@ancient-wolf-19325 in the thread for followups.