ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Osv.Retry

Description

Backoff for Pilot's periodic advisory-source fetches. Bounded exponential waits with full jitter limit repeated load during upstream failures. Ecluse.Core.Fault.Http classifies HTTP failures shared with registry adapters.

Synopsis

Policy

defaultOsvRetryPolicy :: forall (m :: Type -> Type). MonadIO m => RetryPolicyM m Source #

Full jitter from a 1s base to a 60s ceiling, with five retries (six attempts).

Classifying a fetch failure

isRetryableHttpException :: HttpException -> Bool Source #

Classify status failures by HTTP code and other exceptions by transport cause.

isRetryableStatusCode :: Int -> Bool Source #

Whether an HTTP status signals a temporary failure: server errors, timeout, or throttling.

Running a fetch under the policy

withOsvRetry :: (MonadMask m, KatipContext m) => RetryPolicyM m -> m a -> m a Source #

Retry temporary HTTP failures within the policy budget. Other failures propagate immediately.

Log lines

transientMessage :: RetryStatus -> HttpException -> String Source #

The warning logged before a retry of a transient fetch failure. The attempt number is 1-based, because rsIterNumber counts retries from zero.