Can I get the retryAttempt of a task/pass it as an input to a task?
gentle-tomato-480
12/18/2024, 11:52 AM
Following up on the above question, I am thinking to let a task retry 3 times for example, but set 4 times. If the currentAttempt == 4/max_retry_attempts then just return a default value so that the task doesn't block the rest.
gentle-tomato-480
12/18/2024, 11:54 AM
https://docs.flyte.org/en/latest/user_guide/concepts/main_concepts/tasks.html Initially was thinking to use a signal, but I see that if it times out then it will still be marked as failure, so letting the next retry attempt return some default value would be a way to keep the whole workflow from failing because of the timed out task
c
careful-australia-19356
12/18/2024, 10:11 PM
for regular python tasks we guarantee that there will be an environment variable called `FLYTE_ATTEMPT_NUMBER`