Mitch
06/03/2024, 8:38 PMMarvin
06/03/2024, 8:38 PMbash
prefect config set PREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION=True
Cancellation via CLI:
You can also cancel a flow run from the command line using:
bash
prefect flow-run cancel <FLOW_RUN_ID>
For more details, you can refer to the Prefect documentation here.
If these steps do not resolve the issue, consider discussing it on Slack or filing a GitHub issue.Mitch
06/03/2024, 8:41 PMMarvin
06/03/2024, 8:42 PMPREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION=True
improves the handling of cases where flow or task cancellation can fail. Some highlights of this enhanced cancellation feature include:
- Worker Retry Mechanisms: If a worker encounters an error during cancellation, it will attempt the cancellation again, and other workers may also try.
- Improved Cancellation Tracking: The system better handles scenarios where infrastructure specifics (like infrastructure_pid
) are missing, ensuring that cancellation is properly acknowledged.
- Fault Tolerance: Enhanced tolerance to unexpected errors during cancellation processes, providing a more reliable cancellation experience.
You can enable this feature by configuring Prefect with the following command:
bash
prefect config set PREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION=True
For more information, refer to the Prefect documentation on flow cancellation.
If you encounter any issues with this feature, you can report them in the Prefect Slack community or by opening a GitHub issue.Nate
06/03/2024, 9:08 PMMitch
06/03/2024, 9:17 PMMitch
06/03/2024, 9:20 PMNate
06/03/2024, 9:21 PMrun_deployment
for subflows?Mitch
06/03/2024, 9:25 PMMitch
06/04/2024, 5:02 PMNate
06/04/2024, 6:47 PMrun_deployment
specifically here (i can look more into that)
> we're using run_deployment to launch them from the parent, running the jobs in an eks cluster.
a safeguard you could use regardless if you were inclined, is add an on_cancellation
hook that uses client.set_flow_run_state(..., force=True)
for each client.read_flow_runs
where FlowRunParentRunIdFilter(any_=[current_flow_run.id])
hmm im not sure i understand this statement
> Late jobs continue to start even after cancelling the jobs that are currently runningMitch
06/04/2024, 10:06 PM