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 only a recoverable error is retried (LLMError.isRecoverable). 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
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any