<@ULVA73B9P> I'm trying to set up a flow on Prefec...
# ask-marvin
a
@Marvin I'm trying to set up a flow on Prefect Cloud free version using Docker deployment on Cloud Run. The flow includes a task that triggers a Dataflow job and waits for its completion. The thing is the Dataflow job is taking more than 1 hour to complete but the flow gets restarted after 10 minutes, while Dataflow job is still running. However, when running locally is triggering the job and waiting for its completion successfully. I'm not sure that this is connected only with Cloud Run timeout because I changed it to 3600 sec and still have the same behavior and I'm not able to solve it. Any ideas of what could be wrong?
m
Your issue with the Prefect flow restarting after 10 minutes on Cloud Run might be related to a couple of factors. Here are some insights based on the gathered information: 1. Flow Timeout Settings: Prefect has a built-in timeout mechanism to prevent long-running flows. If the flow runs longer than the specified timeout, it will raise a timeout exception and mark the flow as failed. You should ensure that the
timeout_seconds
keyword argument is set appropriately in your flow configuration. Learn more about flow timeouts here. 2. Cloud Run Timeout: While you've adjusted the Cloud Run timeout to 3600 seconds, ensure that this change is properly reflected in the deployment settings. Sometimes deployment configurations might not update as expected. 3. Prefect Cloud Run Worker Configuration: When deploying a Cloud Run worker, make sure that the worker is configured to handle long-running tasks. This might involve adjusting settings related to how the worker polls the work pool. Check the Cloud Run worker setup guide. 4. Potential Bugs or Issues: There are known issues where workers might not respect timeouts, causing them to die prematurely. This could be similar to your situation. You can explore related discussions and potential fixes in the GitHub issues: - Worker dies because timeout is not respected - Intermittent fatal error running deployment with docker infra Given your setup with Docker and Cloud Run, ensure that all configurations align with the expected behavior for long-running tasks. If the problem persists, consider reaching out to the Prefect community or opening an issue with detailed logs to get more targeted assistance.