- integrations
- Python
- ocx_sdk
RetryPolicy
RetryPolicyclassdataclass#
Re-exported from
ocx_sdk._typesView sourceclass RetryPolicy(attempts: int = 3, backoff: float = 1.0, multiplier: float = 2.0, max_backoff: float = 30.0, max_retry_after: float = 300.0, jitter: bool = True, retry_on: frozenset[ExitCode] = frozenset({ExitCode.TEMP_FAIL}), sleep: Callable[[float], None] | None = None)How to retry a failure ocx classified as transient.
Attempt one is not a retry: attempts=3 means at most two backoff waits.
timeout is per attempt, so the worst case is
attempts * timeout + sum(backoff).
Attributes
| Name | Type | Description |
|---|---|---|
attempts | int | Total attempts, including the first. |
backoff | float | Delay before the first retry, in seconds. |
multiplier | float | Growth factor applied to backoff per retry. |
max_backoff | float | Ceiling for the computed delay. |
max_retry_after | float | Ceiling for a server-supplied Retry-After. It is
honored verbatim up to this value rather than truncated to
max_backoff — truncating it would hammer a registry that just
asked for room. Beyond it the answer is to fail, not to wait. |
jitter | bool | Draw the delay uniformly from [0, delay] (AWS full jitter). |
retry_on | frozenset[ExitCode] | Exit codes worth retrying. Applies to the process path
only; _dist classifies by transport condition instead, so this
set does not affect bootstrap.ensure(). |
sleep | Callable[[float], None] | None | Sleep seam, defaulting to time.sleep. Async drivers use
asyncio.sleep and ignore this field. |
attemptsattributeclass attributeinstance attribute#
attempts: int = 3backoffattributeclass attributeinstance attribute#
backoff: float = 1.0jitterattributeclass attributeinstance attribute#
jitter: bool = Truemax_backoffattributeclass attributeinstance attribute#
max_backoff: float = 30.0max_retry_afterattributeclass attributeinstance attribute#
max_retry_after: float = 300.0multiplierattributeclass attributeinstance attribute#
multiplier: float = 2.0retry_onattributeclass attributeinstance attribute#
retry_on: frozenset[ExitCode] = frozenset({ExitCode.TEMP_FAIL})sleepattributeclass attributeinstance attribute#
sleep: Callable[[float], None] | None = None