Documentation
¶
Overview ¶
Package retryx classifies transient failures and retries operations with bounded, jittered exponential backoff.
The classification is deliberately conservative: an error is retried only when repeating the request could plausibly succeed. Authentication failures, missing blobs, permission problems and a full disk are all permanent, and retrying them only delays the report the user needs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = Policy{MaxAttempts: 6, BaseDelay: 300 * time.Millisecond, MaxDelay: 30 * time.Second}
Default is the policy used when the user does not override it.
var ErrRetryable = errors.New("retryable")
ErrRetryable marks an error as worth another attempt when the failure is domain knowledge this package does not have — a checksum that did not match, for instance, which says the bytes arrived wrong and may well arrive right the second time.
Functions ¶
func Describe ¶
Describe returns a short, log-friendly rendering of err. An Azure failure collapses to its status and error code, because the SDK's own message is a multi-line dump of the whole exchange; anything else keeps its own text, which for a filesystem error already names the path.
func Do ¶
Do runs fn until it succeeds, returns a permanent error, or runs out of attempts. The error returned is the last one observed, wrapped with the attempt count when more than one attempt was made.
func IsTransient ¶
IsTransient reports whether err is worth retrying.
func RetryAfter ¶
RetryAfter extracts a server-supplied delay from an HTTP error response.
func RetryableStatus ¶
RetryableStatus reports whether an HTTP status justifies another attempt. It matches the Azure SDK's own default list, so callers can substitute their own retry predicate without changing behaviour.