Edit

Configuring retries

tidekeeper retries failed requests automatically. This page explains which failures are retried, how the delay between attempts grows, and how to change both.

Note

Retries only apply to idempotent methods (GET, HEAD, PUT, DELETE) unless you opt in with retry_unsafe=True.

Defaults

Out of the box, a request is attempted up to three times. The delay doubles after each failure, starting at half a second.

SettingDefaultMeaning
max_attempts3Total tries, including the first
backoff0.5First delay in seconds
retry_on502, 503, 504Status codes that trigger a retry

Writing a custom policy

Pass a RetryPolicy to the client to override the defaults:

from tidekeeper import Client, RetryPolicy

policy = RetryPolicy(max_attempts=5, backoff=1.0, retry_on={429, 503})
client = Client(retry=policy)

Delays are capped at 30 seconds, so a long run of failures never stalls a worker for more than half a minute between attempts.