How a node is run again after its own failure, inside the run.
A node that throws, or returns NodeResult.Fail, is run again against the same committed snapshot while its error passes retryOn and attempts remain. By default an error is retried by the library's one retry rule, org.llm4s.reliability.RetryPolicy.isRetryable: a recoverable error, except a client-error response and an optimistic-lock failure, which repeating the node cannot fix. A cancellation, a result the kernel rejects (an undeclared write, an invalid route) and a suspension are never retried.
The wait after the n-th failed attempt is initialBackoff * backoffFactor^(n-1), at most maxBackoff. It is an interruptible wait: cancelling the run, or its deadline expiring, ends the retries. The attempts belong to one run: recover runs a failed task again with its full policy.
Every value is validated on the way in: apply and the with* setters throw IllegalArgumentException; RetryPolicy.of returns a ValidationError for untrusted input.
Value parameters
- backoffFactor
-
what each further wait is multiplied by; at least
1.0 - initialBackoff
-
the wait after the first failed attempt
- maxAttempts
-
the most times the node is run, the first included;
1means no retry - maxBackoff
-
the longest wait
- retryOn
-
whether an error is worth another attempt
Attributes
- Companion
- object
- Source
- RetryPolicy.scala
- Graph
-
- Supertypes
