Matt Alhonte09/11/2023, 11:00 PM
Marvin09/11/2023, 11:00 PM
argument in Prefect:
In this example, the
python from prefect import task from prefect.tasks import exponential_backoff @task(retries=3, retry_delay_seconds=exponential_backoff(backoff_factor=10, retry_jitter_factor=0.5)) def some_task_with_exponential_backoff_retries(): ...
adds a random amount of time to the delay between retries. This helps to prevent a "thundering herd" scenario, where many tasks all retry at the exact same time, potentially overwhelming your system. The delay will be up to 15 seconds (10 seconds base delay plus up to 50% extra due to the jitter factor). Isn't programming just a barrel of laughs?