colossal-tent-96436
11/06/2025, 2:55 PM@timeout decorator combining with @catch . According to the documentation:
It will cause the step to be retried if needed and the exception will be caught by the @catch decorator, if present.
But that is not behaviour I'm observing. When the timeout is reached the whole process is aborted and the pipeline fails.colossal-tent-96436
11/06/2025, 2:56 PM@catch(var="failure")
@batch(gpu=1)
@timeout(minutes=1)
@step
def set_xyz(self):
...
Same behaviour was observed with Metaflow 2.18.1, 2.18.11 and 2.19.5.colossal-tent-96436
11/06/2025, 2:56 PMStatus reason
Job attempt duration exceeded timeoutancient-application-36103
11/06/2025, 2:56 PMcolossal-tent-96436
11/12/2025, 11:42 AMthankful-ambulance-42457
11/12/2025, 12:05 PMthankful-ambulance-42457
11/14/2025, 4:57 PM@timeout with the @retry decorator to achieve task retries. Was your use-case that you want to retry the step if the timeout is reached?colossal-tent-96436
11/17/2025, 8:57 AM@catch decorator and for the pipeline to proceed with the next steps. What I'm observing is that if the timeout is reached the whole pipeline is failing.
My use-case is that I'm training multiple models in parallel with foreach and when one of the tasks times-out I want to proceed with publishing all the models that did manage to train.thankful-ambulance-42457
11/17/2025, 9:32 AMthankful-ambulance-42457
11/17/2025, 12:26 PMcolossal-tent-96436
11/17/2025, 3:43 PM@batch or without, in simple flow and in foreach) but when executed from AWS Step-functions it fails (I can only do @batch there, but it fails on simple flow as well as on foreach)
This is the only log I got:
Step step_xyz timed out after 0 hours, 1 minutes, 0 seconds
Is there any configuration that may change this behaviour?thankful-ambulance-42457
11/18/2025, 11:46 AMbatch, and it sets an alert timer during the task execution which raises an exception if reached (this can be caught by @catch)
• both the batch timer and the process-level alert have the exact same timeout
it is therefore possible that if finalizing the timed out task takes too long, the batch level timeout kicks in and terminates the taskthankful-ambulance-42457
11/18/2025, 11:51 AM@timeout decorator that should not apply the same timeout on the batch/SFN level.
⚠️ The caveat is that if the task process itself gets stuck for whatever reason, then there is no backstop on how long the batch process will run
This is meant to simply test out whether the issue is caused by having an identical timeout in the task process and on the batch level. The deco should be a drop-in replacement, just drop the file in your flow folder and change the import to from custom_timeout import timeoutthankful-ambulance-42457
11/18/2025, 11:53 AMAttemptDurationSeconds in the Batch job definition by hand to see if that helps.colossal-tent-96436
11/18/2025, 11:54 AM