From c61d976c6f1d934d38afc3097a64f45f36b7c7ad Mon Sep 17 00:00:00 2001 From: Daniel Sola <40698988+dansola@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:17:36 -0700 Subject: [PATCH] Change retry error from RuntimeError to FlyteRecoverableException (#5128) * Change retry error from RuntimeError to FlyteRecoverableException Signed-off-by: Daniel Sola * add fault-tolerance header Signed-off-by: Daniel Sola * add blank line Signed-off-by: Daniel Sola --------- Signed-off-by: Daniel Sola Co-authored-by: Daniel Sola --- docs/concepts/tasks.rst | 2 ++ docs/flyte_fundamentals/optimizing_tasks.md | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/concepts/tasks.rst b/docs/concepts/tasks.rst index 94807d3632..8e5cc7aaec 100644 --- a/docs/concepts/tasks.rst +++ b/docs/concepts/tasks.rst @@ -71,6 +71,8 @@ types in the system. Flyte has a set of defined, battle-tested task types. It al Inherent Features ----------------- +.. _fault-tolerance: + Fault tolerance ^^^^^^^^^^^^^^^ diff --git a/docs/flyte_fundamentals/optimizing_tasks.md b/docs/flyte_fundamentals/optimizing_tasks.md index 9f3124e270..00b3c693f1 100644 --- a/docs/flyte_fundamentals/optimizing_tasks.md +++ b/docs/flyte_fundamentals/optimizing_tasks.md @@ -66,12 +66,13 @@ import random @task(retries=3) def compute_mean(data: List[float]) -> float: if random() < 0.05: - raise RuntimeError("Something bad happened 🔥") + raise FlyteRecoverableException("Something bad happened 🔥") return sum(data) / len(data) ``` ```{note} -Retries only take effect when running a task on a Flyte cluster. +Retries only take effect when running a task on a Flyte cluster. +See {ref}`Fault Tolerance ` for details on the types of errors that will be retried. ``` ## Timeouts