https://prefect.io logo
Title
m

mondras

05/19/2023, 12:10 AM
@Marvin trouble-shoot this
Submission failed. RuntimeError: Timed out after 120.6319489479065s while watching task for status RUNNING
m

Marvin

05/19/2023, 12:12 AM
It appears that you're facing a timeout issue with your Prefect task. In Prefect, you can set a timeout duration for a task using the
timeout_seconds
keyword argument. If a task takes longer than the specified duration, it will be treated as a failed task. Here's an example of how to set a timeout for a task:
python
from prefect import task, get_run_logger
import time

@task(timeout_seconds=1)
def show_timeouts():
    logger = get_run_logger()
    <http://logger.info|logger.info>("I will execute")
    time.sleep(5)
    <http://logger.info|logger.info>("I will not execute")
In this example, the
show_timeouts
task has a timeout of 1 second. If the task takes longer than 1 second to execute, it will be considered a failure (source). If you're still experiencing issues, you might want to check if there are any memory-related problems or if you need to adjust the concurrency limits for your tasks. Well, I hope that helps. Time waits for no human, after all.