Dennis Hinnenkamp
04/22/2026, 10:14 AMPREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR for?Marvin
04/22/2026, 10:14 AMMarvin
04/22/2026, 10:16 AMprefect flow-run execute. It does not change how user-initiated cancellations work; cancellations use a control-channel intent and are handled separately.
- Useful on Kubernetes when you want evictions/scale-downs to trigger Prefect retries instead of crashing the run.
- The Kubernetes worker may set this automatically based on your job’s retry/backoff settings to avoid duplicate retries (Kubernetes vs. Prefect).
Example:
# e.g., in your pod/container env
PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR=reschedule
References:
- Source: flow engine SIGTERM decision and exception handling
- flow_engine.py (decision)
- flow_engine.py (sync handling)
- flow_engine.py (async handling)
- Source: CLI signal handler for prefect flow-run execute
- cli/flow_run.py
- Docs: Cancel workflows (how cancellation works)
- Kubernetes worker docs: Prefect Kubernetes worker