<@ULVA73B9P> I got jobs that are blocked on "cance...
# ask-marvin
p
@Marvin I got jobs that are blocked on "cancelling". How do I make them completely stop?
m
thought for 46.2 seconds
For jobs stuck in a "cancelling" state, here's what you can do: 1. First, try to cancel the flow run through the UI or CLI:
Copy code
bash
prefect flow-run cancel <flow-run-id>
2. If the flow run remains stuck, you can force the state change using the Prefect CLI:
Copy code
bash
prefect flow-run set-state <flow-run-id> cancelled
This will forcefully update the state in Prefect's database. However, be aware that: - This only changes the state in Prefect's database - Any actually running processes might continue running - You may need to manually clean up any infrastructure (e.g., Docker containers, Kubernetes pods) if they're still running For prevention: - Ensure your infrastructure block configurations are correct and up-to-date - When using containers, make sure they're configured to handle termination signals properly - Consider implementing proper cleanup handlers in your flows using
on_completion
or
on_failure
parameters You can find more details about flow run cancellation in the documentation. Would you like me to provide more specific guidance based on your infrastructure setup (e.g., Docker, Kubernetes, etc.)?