Hello! Can anyone help me understand MAX_ATTEMPTS?...
# ask-metaflow
j
Hello! Can anyone help me understand MAX_ATTEMPTS? Got this from the repo but couldnt find more.
MAX_ATTEMPTS is the maximum number of attempts, including the first task, retries, and the final fallback task and its retries.
I am happy it is there, I am running subprocess on the batch tasks and due to change in EC2 instances for the CE, the timeout for them was too short, leading to many fails. They were caught by the @catch decorator for my steps. Eventually the flow crashed with something like, "too many retries! Max_attempts exceeded (6)" or so. What I am trying to understand is what exactly is being counted? Is it 6 retires on any one workers consecutively? Thank you!
1
v
1 default task + 4 retries + 1 fallback tasks = 6 attempts
j
I feel a bit dumb now, so I am running a foreach loop above. With 3 retires and @catch If im not wrong @catch should "skip" a bad task right? edit: i.e if all retries fail, shouldnt "catch" prevent the whole flow from failing?
v
yes, correct. Is it not working for you like that?
j
I remember seeing this work, but today with so many fails, the whole flow failed with error "internal error: too many attempts", i dont have the exact error anymore. So I thought there is more to this than just catch, maybe I am misunderstanding something. Any reason the step would fail even with catch?
v
hmm, that internal error shouldn't happen. Was this a local run or a run scheduled by Step Functions / Argo / Airflow?
j
it was a local run
v
was it one task that showed that "internal error" or multiple tasks?
j
Thats was the end of the console, and there was only one batch task, and in the UI I cant see end step but it says finished.
v
all tasks were running on Batch?
j
only one "step" was running on batch, all the failed tasks are from that step. its a pretty simple flow, like below, with only `sdk_tasks`using batch
Since you mentioned this shouldnt happen, I shall save the full error if I see it again and post it here again. For now, I will fix my timeouts so these wont fail so bad 🙂