<@ULVA73B9P> I have some code inside of a flow whe...
# ask-marvin
b
@Marvin I have some code inside of a flow where I am submitting a task to run, but with a timeout of 600 seconds, see:
Copy code
my_task_future = my_task.submit(context.copy())
    result = my_task_future.result(timeout=600)
Inside of the flow logs where this timeout is reached, I see a stack trace printed, however my flow did not enter a
Failed
state, and instead hung on continuing to run. What do I need to adjust to ensure this flow ends if this timeout is reached?
m
I've reviewed some information from the Prefect documentation and GitHub issues, but I didn't find a specific answer to your problem. There's a mention of suspended flow runs and timeouts in the official Prefect docs, which says that suspended flow runs will time out after one hour by default, and after the timeout, the flow run will fail with a message. However, this doesn't seem directly related to the timeout you're using. For a more pertinent answer, I'd suggest looking into Prefect's timeout features and error handling to ensure that when a task times out, it properly triggers a flow failure or some other state transition. Since no exact match was found, you should also consult the documentation for details on handling task timeouts or consider asking the question in the Prefect community channels, in case this is an unidentified bug or requires a particular configuration. For now, here could be some starter points to consider: 1. Explicitly set the state of the flow run to failed when the task timeout occurs. 2. Utilize state handlers or triggers to define custom failure logic for your flow. 3. Check if there's a need to adjust task or flow configurations to better handle timeouts. Keep in mind that this is based on general knowledge rather than a specific Prefect 2.x feature, so verifying against the latest documentation would be wise. If you're unable to resolve the issue, reporting it as a bug or reaching out for support might be the next best steps.