Describe the current behavior
When a job runs through Kubernetes with a backoff limit of 0 we automatically reschedule the flow run based on the value of this env variable PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR
This is set automatically if the backoff_limit is 0 here even if the value is set as part of the job configuration through the work pool or job variables on a deployment.
|
if isinstance(self.env, dict): |
|
self.env["PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR"] = "reschedule" |
|
elif not any( |
|
v.get("name") == "PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR" |
|
for v in self.env |
|
): |
|
self.env.append( |
|
{ |
|
"name": "PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR", |
|
"value": "reschedule", |
|
} |
|
) |
Describe the proposed behavior
Ideally a user would be able to set PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIOR to some value other than reschedule to opt out of this behavior.
Example Use
No response
Additional context
No response
Describe the current behavior
When a job runs through Kubernetes with a backoff limit of 0 we automatically reschedule the flow run based on the value of this env variable
PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIORThis is set automatically if the backoff_limit is 0 here even if the value is set as part of the job configuration through the work pool or job variables on a deployment.
prefect/src/integrations/prefect-kubernetes/prefect_kubernetes/worker.py
Lines 430 to 441 in 1ff07e6
Describe the proposed behavior
Ideally a user would be able to set
PREFECT_FLOW_RUN_EXECUTE_SIGTERM_BEHAVIORto some value other than reschedule to opt out of this behavior.Example Use
No response
Additional context
No response