Other Topics
Timeouts and Retries
You can customize the default timeout and retry behavior for your tasks.
Timeouts
Default Timeouts
Tasks automatically timeout after 20 minutes if they haven’t started running. This default exists to prevent stuck tasks from consuming compute resources and potentially blocking other tasks in the queue.
Customizing Timeouts
You can specify your own timeouts. Timeouts can be used for endpoints, task queues, and functions:
timeout.py
Retries
Beam includes retry logic, which can be customized using the parameters below.
Max Retries
You can configure tasks to automatically retry based on a specific exception in your app.
In the example below, we’ll specify retries
and retry_for
:
timeout.py
Retry for Exceptions
When the task is invoked, we’ll see the exception get caught and the task automatically retry:
Was this page helpful?