EvSys

retry

Retry decorator + report for connection-style transient errors.

Wraps a callable; retries on a configurable set of exceptions with exponential backoff. Exhausted failures are pushed onto a RetryReport so the eval harness can surface them in the final report rather than aborting.

attributeT
= TypeVar('T')
func_default_retriable_exceptions() -> tuple[type[BaseException], ...]

Returns

tuple[type[BaseException], ...]
funccall_with_retry(fn, *args, *, max_attempts=5, backoff_base=1.0, backoff_cap=16.0, retriable=None, report=None, context='', **kwargs) -> T | None

Call fn(*args, **kwargs) retrying on transient errors.

On exhaustion: records to report (if supplied) and returns None. Non-transient exceptions propagate immediately - eval bugs shouldn't be silently retried.

paramfnCallable[..., T]
paramargsAny
= ()
parammax_attemptsint
= 5
parambackoff_basefloat
= 1.0
parambackoff_capfloat
= 16.0
paramretriabletuple[type[BaseException], ...] | None
= None
paramreportRetryReport | None
= None
paramcontextstr
= ''
paramkwargsAny
= {}

Returns

evsys_sdk.eval.retry.T | None