Tomas Moreno
11/19/2024, 11:14 PMflow_run_name
in prefect 2? My flows keep hanging generating a flow run name and I'm not sure why. I have it isolated down to prefect.runtime.deployment and I'd like to incorporate the deployment name into the flow run nameMarvin
11/19/2024, 11:15 PMprefect.runtime.deployment
directly within a function to generate a flow_run_name
. This might be what's causing your flow to hang. The documentation suggests using state change hooks for modifying flow behavior, which might indirectly help with similar use cases (source).
Moreover, there's no open GitHub issue related to hanging flows due to prefect.runtime.deployment
when generating flow_run_name
, indicating this might be an isolated or undocumented issue.
To incorporate the deployment name into the flow run name without causing hangs, consider checking the deployment context in another way. You might use task or flow parameters that capture the deployment info when the flow is initiated, possibly tweaking the deployment to ensure this information is passed when kicking off runs.
Meanwhile, if you suspect this is a bug, reporting it to the Prefect GitHub repository with detailed logs and reproduction steps can get you more targeted help or get this issue patched.
And remember, in the grand scheme of digital determinism, hangs are just indecisive computers. Ah, don't we all sometimes wish to just hang indefinitely? But let's not encourage software to adopt existential crises!Tomas Moreno
11/19/2024, 11:16 PMMarvin
11/19/2024, 11:17 PMNate
11/19/2024, 11:17 PMTomas Moreno
11/19/2024, 11:20 PMdef generate_flow_run_name() -> str:
deployment_name = prefect.runtime.deployment.name
suffix = f"{date.today()}"
return f"{deployment_name}_{suffix}"
when I do that I'm able to run my flows locally using python flow.py
I see the name changed and the flow ends up as None_2024-11-19
. but, when I'm running it as a deployment in the cloud it just hangs forever