Hi Prefect, It seems that a Tasks `on_failure` ha...
# ask-community
p
Hi Prefect, It seems that a Tasks
on_failure
handler is called even when there is retry logic added to the Task, and the task still hasn't exhausted its
max_retries
. (I think I just had a Task on which the
on_failure
handler was called, even though it succeeded in a retry.) Is there a way to add a failure handler that is called only after the task has exhausted all its retries and has truly failed?
k
Could you give me a minimum reproducible example for this one?
p
I circumvented the issue by switching to Triggers instead of using
on_failure
k
Oh ok thanks for letting me know. We were looking into this and you’re right because the task goes from Running -> Failed -> Retrying and the failed hits the state handler.
👍 1
p
Thanks for letting me know that you also run into this. I thought this was unexpected behavior, and was surprised by it.