Mitch
04/15/2026, 3:30 AMtimeout_seconds is cooperative - it relies on Python's async machinery to raise a TimeoutError. If the underlying process is hung (e.g., a stuck CUDA call, a blocked C extension, a deadlocked subprocess), Python can't interrupt it and the timeout never fires.
>
> If I define an activeDeadlineSeconds parameter on the k8's job, Prefect's Kopf observer crashes trying to report the crash and it get's ghost requeued.
Would this means that k8's native automatic force kill on a pod or job that get's orphaned or runs to long does not work because Prefect will automatically replace it. Even cancelling the job often does not work because there are blocking processes inside the pod that prevent Prefect's termination signal... Although Prefect 2 had nuances, it did not recreate a pod that's killed by k8's if the job was configured correctly.
prefect==3.6.22
prefect-aws==0.7.6
prefect-docker==0.7.1
prefect-kubernetes==0.7.7
prefect-ray==0.4.5
Even after trying some solutions here:
https://prefect-community.slack.com/archives/C04DZJC94DC/p1776218211252279Mitch
04/15/2026, 3:44 AMMitch
04/15/2026, 3:47 AMalex
04/20/2026, 4:25 PMMitch
04/20/2026, 5:11 PMPREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR = "crash" to the job template so that Prefect will mark it as crashed instead of implicitly retrying
• For the cancellation issue, we had to add a redis queue so that such events can be properly handled across server replicas and 1,000 flowsalex
04/20/2026, 5:18 PMMitch
04/20/2026, 5:26 PMMitch
04/20/2026, 5:27 PMalex
04/20/2026, 5:29 PMMitch
04/20/2026, 5:30 PM