Use ResponseClassifier.RetryOnChannelClosed for the ResponseClassifier equivalent.
A RetryPolicy that never retries.
A RetryPolicy that never retries.
none for a more generally applicable version.
An extractor for exceptions which are known to be safe to retry.
An extractor for exceptions which are known to be safe to retry.
Use ResponseClassifier.RetryOnTimeout for the ResponseClassifier equivalent.
Failures that are generally retryable because the request failed before it finished being written to the remote service.
Failures that are generally retryable because the request failed before it finished being written to the remote service. See com.twitter.finagle.WriteException.
Lifts a function of type A => Option[(Duration, RetryPolicy[A])]
in the RetryPolicy
type.
Retry based on a series of backoffs defined by a Stream[Duration]
.
Retry based on a series of backoffs defined by a Stream[Duration]
. The
stream is consulted to determine the duration after which a request is to
be retried. A PartialFunction
argument determines which request types
are retryable.
backoffJava for a Java friendly API.
A version of backoff usable from Java.
A version of backoff usable from Java.
can be created via Backoff.toJava.
Combines multiple RetryPolicy
s into a single combined RetryPolicy
, with interleaved
backoffs.
Combines multiple RetryPolicy
s into a single combined RetryPolicy
, with interleaved
backoffs. For a given value of A
, each policy in policies
is tried in order. If all
policies return None
, then the combined RetryPolicy
returns None
. If policy P
returns
Some((D, P'))
, then the combined RetryPolicy
returns Some((D, P))
is a
new combined , where
PRetryPolicy
with the same sub-policies, with the exception of P
replaced by
P'
.
The ordering of policies matters: earlier policies get a chance to handle the failure before later policies; a catch-all policy, if any, should be last.
As an example, let's say you combine two RetryPolicy
s, R1
and R2
, where R1
handles
only exception E1
with a backoff of (10.milliseconds, 20.milliseconds, 30.milliseconds)
,
while R2
handles only exception E2
with a backoff of (15.milliseconds, 25.milliseconds)
.
If a sequence of exceptions, (E2, E1, E1, E2)
, is fed in order to the combined retry policy,
the backoffs seen will be (15.milliseconds, 10.milliseconds, 20.milliseconds,
25.milliseconds)
.
The maximum number of retries the combined policy could allow under the worst case scenario
of exceptions is equal to the sum of the individual maximum retries of each subpolicy. To
put a cap on the combined maximum number of retries, you can call limit
on the combined
policy with a smaller cap.
A RetryPolicy that never retries.
Try up to a specific number of times of times on failures that are com.twitter.finagle.service.RetryPolicy.WriteExceptionsOnly.
Try up to a specific number of times of times on failures that are com.twitter.finagle.service.RetryPolicy.WriteExceptionsOnly.
The returned policy has jittered backoffs between retries.
the maximum number of attempts (including retries) that can be made.
A value of 1
means one attempt and no retries on failure.
A value of 2
means one attempt and then a single retry if the failure meets the
criteria of com.twitter.finagle.service.RetryPolicy.WriteExceptionsOnly.
Try up to a specific number of times, based on the supplied PartialFunction[A, Boolean]
.
Try up to a specific number of times, based on the supplied PartialFunction[A, Boolean]
.
A value of type A
is considered retryable if and only if the PartialFunction
is defined at and returns true for that value.
The returned policy has jittered backoffs between retries.
the maximum number of attempts (including retries) that can be made.
A value of 1
means one attempt and no retries on failure.
A value of 2
means one attempt and then a single retry if the failure meets the
criteria of shouldRetry
.
which A
-typed values are considered retryable.