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. A download cut short retries too.

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) => Text -> RetryPolicyM m -> m a -> m a Source #

Retry temporary HTTP failures within the policy budget, warning before each retry. Other failures propagate immediately.

Log lines

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

The warning before a retry, which names a status by the feed's host:port. The attempt number is 1-based, as rsIterNumber counts from zero.