Lev Zemlyanov
03/17/2025, 9:15 PMMarvin
03/17/2025, 9:16 PMcancel_all_tasks
that can be invoked to attempt canceling all running tasks in a flow. This is part of the flow's task runner. You can explore using this method programmatically if you have access to the flow's task runner. For more details, you can look at the flow engine source code.
3. Handling Crashes: When handling crashes, ensure that the state is updated correctly to reflect the crash, which can help in managing subsequent task cancellations. The flow engine in Prefect has mechanisms to handle and log crashes which might be useful for debugging and managing task states.
4. Infrastructure Identifiers: Make sure the identifiers for your infrastructure (like Docker container IDs or Kubernetes job names) are correctly set up to ensure proper cancellation.
In summary, check your infrastructure's cancellation support, consider using the cancel_all_tasks
method if applicable, and ensure proper state handling during crashes. If you need further customization, you might have to dive into the flow engine's internals or adjust your infrastructure setup.Lev Zemlyanov
03/17/2025, 9:31 PMMarvin
03/17/2025, 9:31 PM