amoghrajesh commented on code in PR #77197:
URL: https://github.com/apache/airflow/pull/77197#discussion_r4613271573


##########
providers/cncf/kubernetes/docs/operators.rst:
##########
@@ -243,6 +243,11 @@ persisted, the operator falls back to the same label 
search ``reattach_on_restar
 used, so a running pod from a prior attempt is still found and reattached to 
rather than
 duplicated. Once an identity is persisted, subsequent retries skip the label 
search entirely.
 
+By default, a try interrupted by ``execution_timeout`` deletes the pod (per 
``on_finish_action``), so the retry
+starts a fresh pod. To let the retry reattach instead, set 
``on_kill_action="keep_pod"``: the pod is left running
+and is not marked as already checked. With retries exhausted, the last pod is 
left running and must be cleaned
+up manually. This applies to sync mode with ``durable=True`` only.

Review Comment:
   Handled in 9a43a656c96



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -932,6 +941,13 @@ def execute_sync(self, context: Context):
             self.remote_pod = self.pod_manager.await_pod_completion(
                 self.pod, istio_enabled, self.base_container_name, 
self.do_xcom_push
             )
+        except AirflowTaskTimeout:
+            # The task runner calls on_kill only after this propagates, so 
cleanup has to know now
+            # that the pod must be left running for the next try to reattach.
+            self._keep_pod_after_timeout = (
+                self.reattach_on_restart and self.on_kill_action == 
OnKillAction.KEEP_POD

Review Comment:
   Handled in 9a43a656c96



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to