chris
01/04/2025, 2:12 AMMarvin
01/04/2025, 2:12 AMFlowRunTimeoutError
is raised. You can implement this in your flow configuration to ensure that long-running flows are automatically stopped and marked as failed if they exceed the specified duration.
2. State Management: Prefect states are rich objects that provide information about the status of a flow or task run. You might want to explore the state management features of Prefect to programmatically update or transition states if you detect that a flow is not running as expected.
You can refer to the following resources for more details:
- Flow Engine Source Code which includes handling for flow run timeouts.
- Manage States in Prefect for insights on state management and how to handle different states.
These resources should help you configure your flows to better handle unexpected states in the dashboard.Nate
01/04/2025, 2:25 AMexpect
a prefect.flow-run.Completed
event after
prefect.flow-run.Running
event within
some amount of time like 3600
and it can use the prefect client to call the delete_flow_runs
client method with a filterNate
01/04/2025, 2:26 AMyou can set timeouts! you can also setup a deployment that has a trigger which willaexpect
eventprefect.flow-run.Completed
after
eventprefect.flow-run.Running
some amount of time likewithin
3600
and it can use the prefect client to call theclient method with a filterdelete_flow_runs
Marvin
01/04/2025, 2:26 AMFlowRunTimeoutError
is raised. This can be handled within your flow logic to transition the flow to a terminal state.
2. Event-Based Triggers: You can set up a deployment with a trigger that expects a prefect.flow-run.Completed
event after a prefect.flow-run.Running
event within a specified timeframe (e.g., 3600 seconds). If the expected event does not occur within the timeframe, you can take corrective actions such as terminating the run.
3. Using Prefect Client: You can utilize the Prefect client to programmatically manage flow runs. For instance, the delete_flow_runs
client method can be used to delete flow runs based on specific filters. This can be part of a cleanup process triggered by the absence of a completion event.
For more details, you can refer to:
- Automations and Triggers in Prefect for setting up event-based triggers.
- Flow Engine and Timeout Handling for understanding how timeouts are managed.
These strategies should help you manage flow runs that are inaccurately marked as "running" in the dashboard.Nate
01/04/2025, 2:28 AMchris
01/04/2025, 2:43 AMNate
01/04/2025, 2:43 AMNate
01/04/2025, 2:43 AM