Default Timeouts

Tasks automatically timeout after 20 minutes. 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
from beam import function
import time


@function(timeout=600) # Override default timeout
def timeout():
    import time

    # Without the timeout specified above, this function would timeout at 300s
    time.sleep(350)


if __name__ == "__main__":
    timeout()