You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Pranaykarvi (via GitHub)" <gi...@apache.org> on 2026/03/19 06:58:01 UTC

[PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Pranaykarvi opened a new pull request, #63915:
URL: https://github.com/apache/airflow/pull/63915

   ## Problem
   
   When a Kubernetes Job retries (creates a new pod after a pod failure), `GKEJobTrigger` keeps tracking the original pod names set at trigger creation time. It waits for XCom on the failed pod instead of the new retry pod. This causes the XCom sidecar on the retry pod to never receive a termination signal, leaving the pod running until the job's `activeDeadlineSeconds` is exceeded and failing the task.
   
   ## Fix
   
   Before XCom extraction, re-discover all current pods for the job using the `job-name=<job_name>` label selector. Filter to only succeeded pods and extract XCom from those. Falls back to original pod list if no succeeded pods are found.
   
   Added `list_pods()` async method to `GKEKubernetesAsyncHook` to support pod discovery by label selector.
   
   ## Testing
   
   Added unit test `test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod` that verifies the trigger uses the succeeded retry pod for XCom extraction when the original pod failed.
   
   Fixes #63838


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "Pranaykarvi (via GitHub)" <gi...@apache.org>.
Pranaykarvi commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4134415043

   Fixed the mypy failure in `hooks/kubernetes.py`:
   
   - Wrapped `list_namespaced_event()` arguments into `kwargs: dict[str, Any]`
     to resolve the incompatible type error flagged by mypy
   - No logic change, purely a type annotation fix


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rediscover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #63915:
URL: https://github.com/apache/airflow/pull/63915


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on code in PR #63915:
URL: https://github.com/apache/airflow/pull/63915#discussion_r2990431777


##########
providers/google/tests/unit/google/cloud/triggers/test_kubernetes_engine.py:
##########
@@ -589,3 +589,74 @@ def test_hook(self, mock_hook, job_trigger):
             impersonation_chain=IMPERSONATION_CHAIN,
         )
         assert hook_actual == hook_expected
+
+    @pytest.mark.asyncio
+    @mock.patch(f"{GKE_TRIGGERS_PATH}.ProvidersManager")
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.pod_manager", new_callable=mock.PropertyMock)
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.hook")
+    async def test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod(
+        self, mock_hook, mock_pod_manager_prop, mock_providers_manager
+    ):
+        """When a job has a failed pod and a succeeded retry pod, use the succeeded pod for XCom."""
+        mock_providers_manager.return_value.providers = {
+            "apache-airflow-providers-cncf-kubernetes": mock.MagicMock(
+                data={"package-name": "apache-airflow-providers-cncf-kubernetes"},
+                version="8.4.1",
+            )
+        }
+
+        failed_pod = mock.MagicMock()
+        failed_pod.metadata.name = "original-failed-pod"
+        failed_pod.status.phase = "Failed"
+
+        succeeded_pod = mock.MagicMock()
+        succeeded_pod.metadata.name = "retry-succeeded-pod"
+        succeeded_pod.status.phase = "Succeeded"
+
+        mock_hook.list_pods = mock.AsyncMock(return_value=[failed_pod, succeeded_pod])
+        mock_hook.wait_until_container_complete = mock.AsyncMock()
+        mock_hook.wait_until_container_started = mock.AsyncMock()
+        mock_hook.wait_until_job_complete = mock.AsyncMock()
+        mock_job = mock.MagicMock()
+        mock_job.metadata.name = JOB_NAME
+        mock_job.metadata.namespace = NAMESPACE
+        mock_job.to_dict.return_value = {"job": "dict"}
+        mock_hook.wait_until_job_complete.return_value = mock_job
+        mock_hook.is_job_failed = mock.MagicMock(return_value=False)
+
+        mock_pod_manager = mock.MagicMock()
+        mock_pod_manager.extract_xcom.return_value = {"xcom": "result"}
+        mock_pod_manager_prop.return_value = mock_pod_manager
+
+        def run_in_executor(_executor, func, *args):
+            result = func(*args)
+            loop = asyncio.get_running_loop()
+            f = loop.create_future()
+            f.set_result(result)
+            return f

Review Comment:
   I don’t think we need to mock the executor loop here. `extract_xcom` is already mocked and lightweight, so letting it run via `run_in_executor` should be fast and deterministic.



##########
providers/google/tests/unit/google/cloud/triggers/test_kubernetes_engine.py:
##########
@@ -589,3 +589,74 @@ def test_hook(self, mock_hook, job_trigger):
             impersonation_chain=IMPERSONATION_CHAIN,
         )
         assert hook_actual == hook_expected
+
+    @pytest.mark.asyncio
+    @mock.patch(f"{GKE_TRIGGERS_PATH}.ProvidersManager")
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.pod_manager", new_callable=mock.PropertyMock)
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.hook")
+    async def test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod(
+        self, mock_hook, mock_pod_manager_prop, mock_providers_manager
+    ):
+        """When a job has a failed pod and a succeeded retry pod, use the succeeded pod for XCom."""
+        mock_providers_manager.return_value.providers = {
+            "apache-airflow-providers-cncf-kubernetes": mock.MagicMock(
+                data={"package-name": "apache-airflow-providers-cncf-kubernetes"},
+                version="8.4.1",
+            )
+        }
+
+        failed_pod = mock.MagicMock()
+        failed_pod.metadata.name = "original-failed-pod"
+        failed_pod.status.phase = "Failed"
+
+        succeeded_pod = mock.MagicMock()
+        succeeded_pod.metadata.name = "retry-succeeded-pod"
+        succeeded_pod.status.phase = "Succeeded"
+
+        mock_hook.list_pods = mock.AsyncMock(return_value=[failed_pod, succeeded_pod])
+        mock_hook.wait_until_container_complete = mock.AsyncMock()
+        mock_hook.wait_until_container_started = mock.AsyncMock()
+        mock_hook.wait_until_job_complete = mock.AsyncMock()

Review Comment:
   Maybe you could a blank line here? Right now, it's a bit too dense.



##########
providers/google/src/airflow/providers/google/cloud/triggers/kubernetes_engine.py:
##########
@@ -333,9 +333,27 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     f"package {kubernetes_provider_name}=={kubernetes_provider_version} which doesn't "
                     f"support this feature. Please upgrade it to version higher than or equal to {min_version}."
                 )
+            # Re-discover pods for this job to handle retry scenarios
+            # where the original pod failed and a new pod was created
+            label_selector = f"job-name={self.job_name}"
+            current_pods = await self.hook.list_pods(
+                namespace=self.pod_namespace,
+                label_selector=label_selector,
+            )
+            succeeded_pods = [p for p in current_pods if p.status and p.status.phase == "Succeeded"]
+            if not succeeded_pods:
+                self.log.warning(
+                    "No succeeded pods found for job %s, falling back to original pod list",
+                    self.job_name,
+                )
+                succeeded_pods = [
+                    await self.hook.get_pod(name=pod_name, namespace=self.pod_namespace)

Review Comment:
   Why are you doing an API call for every pod here when you have called `list_pods` already? I would suggest something like this instead
   
   ```
       succeeded_pods = [
           p for p in current_pods
           if p.metadata.name in self.pod_names
       ]
   ```



##########
providers/google/tests/unit/google/cloud/triggers/test_kubernetes_engine.py:
##########
@@ -589,3 +589,74 @@ def test_hook(self, mock_hook, job_trigger):
             impersonation_chain=IMPERSONATION_CHAIN,
         )
         assert hook_actual == hook_expected
+
+    @pytest.mark.asyncio
+    @mock.patch(f"{GKE_TRIGGERS_PATH}.ProvidersManager")
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.pod_manager", new_callable=mock.PropertyMock)
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.hook")
+    async def test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod(
+        self, mock_hook, mock_pod_manager_prop, mock_providers_manager
+    ):
+        """When a job has a failed pod and a succeeded retry pod, use the succeeded pod for XCom."""
+        mock_providers_manager.return_value.providers = {
+            "apache-airflow-providers-cncf-kubernetes": mock.MagicMock(
+                data={"package-name": "apache-airflow-providers-cncf-kubernetes"},
+                version="8.4.1",
+            )
+        }
+
+        failed_pod = mock.MagicMock()
+        failed_pod.metadata.name = "original-failed-pod"
+        failed_pod.status.phase = "Failed"
+
+        succeeded_pod = mock.MagicMock()
+        succeeded_pod.metadata.name = "retry-succeeded-pod"
+        succeeded_pod.status.phase = "Succeeded"
+
+        mock_hook.list_pods = mock.AsyncMock(return_value=[failed_pod, succeeded_pod])
+        mock_hook.wait_until_container_complete = mock.AsyncMock()
+        mock_hook.wait_until_container_started = mock.AsyncMock()
+        mock_hook.wait_until_job_complete = mock.AsyncMock()
+        mock_job = mock.MagicMock()
+        mock_job.metadata.name = JOB_NAME
+        mock_job.metadata.namespace = NAMESPACE
+        mock_job.to_dict.return_value = {"job": "dict"}
+        mock_hook.wait_until_job_complete.return_value = mock_job
+        mock_hook.is_job_failed = mock.MagicMock(return_value=False)
+
+        mock_pod_manager = mock.MagicMock()
+        mock_pod_manager.extract_xcom.return_value = {"xcom": "result"}
+        mock_pod_manager_prop.return_value = mock_pod_manager
+
+        def run_in_executor(_executor, func, *args):
+            result = func(*args)
+            loop = asyncio.get_running_loop()
+            f = loop.create_future()
+            f.set_result(result)
+            return f
+
+        with mock.patch.object(asyncio.get_running_loop(), "run_in_executor", side_effect=run_in_executor):
+            trigger = GKEJobTrigger(
+                cluster_url=CLUSTER_URL,
+                ssl_ca_cert=SSL_CA_CERT,
+                job_name=JOB_NAME,
+                job_namespace=NAMESPACE,
+                pod_names=[POD_NAME],
+                pod_namespace=NAMESPACE,
+                base_container_name=BASE_CONTAINER_NAME,
+                gcp_conn_id=GCP_CONN_ID,
+                poll_interval=POLL_INTERVAL,
+                impersonation_chain=IMPERSONATION_CHAIN,
+                get_logs=GET_LOGS,
+                do_xcom_push=True,
+            )
+            event = await trigger.run().asend(None)
+
+        mock_hook.list_pods.assert_called_once_with(
+            namespace=NAMESPACE,
+            label_selector=f"job-name={JOB_NAME}",
+        )
+        assert mock_pod_manager.extract_xcom.call_count == 1
+        assert mock_pod_manager.extract_xcom.call_args[0][0] is succeeded_pod
+        assert mock_pod_manager.extract_xcom.call_args[0][0].metadata.name == "retry-succeeded-pod"
+        assert event.payload["xcom_result"] == [{"xcom": "result"}]

Review Comment:
   I think these asserts can be simplified to:
   
   ```
   mock_pod_manager.extract_xcom.assert_called_once_with(succeeded_pod)
   assert event.payload["xcom_result"] == [{"xcom": "result"}]
   ```
   
   The 2 asserts inthe middle are duplicative and can be covered by `assert_called_once_with`.
   
   Also, looking at the bug report, I think we should add asserts for the container wait calls:
   
   ```
   mock_hook.wait_until_container_complete.assert_called_once_with(
       name="retry-succeeded-pod",
       namespace=NAMESPACE,
       container_name=BASE_CONTAINER_NAME,
       poll_interval=POLL_INTERVAL,
   )
   
   mock_hook.wait_until_container_started.assert_called_once_with(
       name="retry-succeeded-pod",
       namespace=NAMESPACE,
       container_name=PodDefaults.SIDECAR_CONTAINER_NAME,
       poll_interval=POLL_INTERVAL,
   )
   ```
   
   The crux of the issue is that the trigger was waiting on the old pod, which eventually expired and caused the deadline to be exceeded. These asserts make sure we are consistently operating on the correct pod, not just during XCom extraction.



##########
providers/google/tests/unit/google/cloud/triggers/test_kubernetes_engine.py:
##########
@@ -589,3 +589,74 @@ def test_hook(self, mock_hook, job_trigger):
             impersonation_chain=IMPERSONATION_CHAIN,
         )
         assert hook_actual == hook_expected
+
+    @pytest.mark.asyncio
+    @mock.patch(f"{GKE_TRIGGERS_PATH}.ProvidersManager")
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.pod_manager", new_callable=mock.PropertyMock)
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.hook")
+    async def test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod(
+        self, mock_hook, mock_pod_manager_prop, mock_providers_manager
+    ):
+        """When a job has a failed pod and a succeeded retry pod, use the succeeded pod for XCom."""
+        mock_providers_manager.return_value.providers = {
+            "apache-airflow-providers-cncf-kubernetes": mock.MagicMock(
+                data={"package-name": "apache-airflow-providers-cncf-kubernetes"},
+                version="8.4.1",
+            )
+        }
+
+        failed_pod = mock.MagicMock()
+        failed_pod.metadata.name = "original-failed-pod"
+        failed_pod.status.phase = "Failed"
+
+        succeeded_pod = mock.MagicMock()
+        succeeded_pod.metadata.name = "retry-succeeded-pod"
+        succeeded_pod.status.phase = "Succeeded"
+
+        mock_hook.list_pods = mock.AsyncMock(return_value=[failed_pod, succeeded_pod])
+        mock_hook.wait_until_container_complete = mock.AsyncMock()
+        mock_hook.wait_until_container_started = mock.AsyncMock()
+        mock_hook.wait_until_job_complete = mock.AsyncMock()
+        mock_job = mock.MagicMock()
+        mock_job.metadata.name = JOB_NAME
+        mock_job.metadata.namespace = NAMESPACE
+        mock_job.to_dict.return_value = {"job": "dict"}
+        mock_hook.wait_until_job_complete.return_value = mock_job
+        mock_hook.is_job_failed = mock.MagicMock(return_value=False)
+
+        mock_pod_manager = mock.MagicMock()
+        mock_pod_manager.extract_xcom.return_value = {"xcom": "result"}
+        mock_pod_manager_prop.return_value = mock_pod_manager
+
+        def run_in_executor(_executor, func, *args):
+            result = func(*args)
+            loop = asyncio.get_running_loop()
+            f = loop.create_future()
+            f.set_result(result)
+            return f
+
+        with mock.patch.object(asyncio.get_running_loop(), "run_in_executor", side_effect=run_in_executor):
+            trigger = GKEJobTrigger(
+                cluster_url=CLUSTER_URL,
+                ssl_ca_cert=SSL_CA_CERT,
+                job_name=JOB_NAME,
+                job_namespace=NAMESPACE,
+                pod_names=[POD_NAME],
+                pod_namespace=NAMESPACE,
+                base_container_name=BASE_CONTAINER_NAME,
+                gcp_conn_id=GCP_CONN_ID,
+                poll_interval=POLL_INTERVAL,
+                impersonation_chain=IMPERSONATION_CHAIN,
+                get_logs=GET_LOGS,
+                do_xcom_push=True,
+            )

Review Comment:
   I don't see the need to re-initialize `GKEJobTrigger` here when you can use the `job_trigger` fixture instead and set `job_trigger.do_xcom_push` to True. 



##########
providers/google/tests/unit/google/cloud/triggers/test_kubernetes_engine.py:
##########
@@ -589,3 +589,74 @@ def test_hook(self, mock_hook, job_trigger):
             impersonation_chain=IMPERSONATION_CHAIN,
         )
         assert hook_actual == hook_expected
+
+    @pytest.mark.asyncio
+    @mock.patch(f"{GKE_TRIGGERS_PATH}.ProvidersManager")
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.pod_manager", new_callable=mock.PropertyMock)
+    @mock.patch(f"{TRIGGER_GKE_JOB_PATH}.hook")
+    async def test_run_do_xcom_push_uses_succeeded_retry_pod_not_original_failed_pod(
+        self, mock_hook, mock_pod_manager_prop, mock_providers_manager
+    ):
+        """When a job has a failed pod and a succeeded retry pod, use the succeeded pod for XCom."""
+        mock_providers_manager.return_value.providers = {
+            "apache-airflow-providers-cncf-kubernetes": mock.MagicMock(
+                data={"package-name": "apache-airflow-providers-cncf-kubernetes"},
+                version="8.4.1",
+            )
+        }
+
+        failed_pod = mock.MagicMock()
+        failed_pod.metadata.name = "original-failed-pod"
+        failed_pod.status.phase = "Failed"
+
+        succeeded_pod = mock.MagicMock()
+        succeeded_pod.metadata.name = "retry-succeeded-pod"
+        succeeded_pod.status.phase = "Succeeded"
+
+        mock_hook.list_pods = mock.AsyncMock(return_value=[failed_pod, succeeded_pod])
+        mock_hook.wait_until_container_complete = mock.AsyncMock()
+        mock_hook.wait_until_container_started = mock.AsyncMock()
+        mock_hook.wait_until_job_complete = mock.AsyncMock()
+        mock_job = mock.MagicMock()
+        mock_job.metadata.name = JOB_NAME
+        mock_job.metadata.namespace = NAMESPACE
+        mock_job.to_dict.return_value = {"job": "dict"}

Review Comment:
   A blank line here too as well. This is for readability.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rediscover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on code in PR #63915:
URL: https://github.com/apache/airflow/pull/63915#discussion_r3115406005


##########
providers/google/src/airflow/providers/google/cloud/triggers/kubernetes_engine.py:
##########
@@ -333,9 +333,24 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     f"package {kubernetes_provider_name}=={kubernetes_provider_version} which doesn't "
                     f"support this feature. Please upgrade it to version higher than or equal to {min_version}."
                 )
+            # Re-discover pods for this job to handle retry scenarios
+            # where the original pod failed and a new pod was created
+            label_selector = f"job-name={self.job_name}"
+            current_pods = await self.hook.list_pods(
+                namespace=self.pod_namespace,
+                label_selector=label_selector,
+            )
+            succeeded_pods = [p for p in current_pods if p.status and p.status.phase == "Succeeded"]
+            if not succeeded_pods:

Review Comment:
   Maybe we should wrap it in an `while True` loop (+timeout) rather an if statment? 
   Otherwise, there are scenarios where this logic can still fail, for example if we query too early and no pod is Succeeded yet, we fall back to the original pod list and can miss the replacement retry pod that later succeeds and contains the real XCom.



##########
providers/google/src/airflow/providers/google/cloud/triggers/kubernetes_engine.py:
##########
@@ -333,9 +333,24 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                     f"package {kubernetes_provider_name}=={kubernetes_provider_version} which doesn't "
                     f"support this feature. Please upgrade it to version higher than or equal to {min_version}."
                 )
+            # Re-discover pods for this job to handle retry scenarios
+            # where the original pod failed and a new pod was created
+            label_selector = f"job-name={self.job_name}"
+            current_pods = await self.hook.list_pods(
+                namespace=self.pod_namespace,
+                label_selector=label_selector,
+            )
+            succeeded_pods = [p for p in current_pods if p.status and p.status.phase == "Succeeded"]
+            if not succeeded_pods:

Review Comment:
   Maybe we should wrap it in an `while True` loop (+timeout) rather an if statment? 
   Otherwise, there are scenarios where this logic can still fail, for example - if we query too early and no pod is Succeeded yet, we fall back to the original pod list and can miss the replacement retry pod that later succeeds and contains the real XCom.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rediscover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "Pranaykarvi (via GitHub)" <gi...@apache.org>.
Pranaykarvi commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4286380872

   Good catch @shahar1! Replaced the `if` fallback with a polling loop using 
   `time.monotonic()` + `await asyncio.sleep(self.poll_interval)` that retries 
   until a succeeded pod is found or a timeout of `poll_interval * 10` is reached. 
   Falls back to the original pod list only after the timeout. Please take another look!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4138825759

   > Can someone trigger CI?
   > 
   > @shahar1 @potiuk 
   
   Unfortunately I can't, probably due to a weird GitHub behavior.
   @Pranaykarvi could you please resolve the other comments made by Sameer and rebase onto `main`?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4134488776

   Can someone trigger CI?
   
   @shahar1 @potiuk 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "Pranaykarvi (via GitHub)" <gi...@apache.org>.
Pranaykarvi commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4141852941

   Hi @SameerMesiah97, I’ve addressed all comments and rebased onto latest `main`.
   Resolved the merge conflict while preserving both typing (`dict[str, Any]`) and upstream logic.
   
   Ready for final review, thanks!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "Pranaykarvi (via GitHub)" <gi...@apache.org>.
Pranaykarvi commented on code in PR #63915:
URL: https://github.com/apache/airflow/pull/63915#discussion_r3004672751


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -1081,7 +1081,6 @@ async def get_pod_events(
                 if resource_version is not None:
                     kwargs["resource_version"] = resource_version
                     kwargs["resource_version_match"] = "NotOlderThan"
-

Review Comment:
   Done, restored the accidentally removed blank line. Thanks for catching it!



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #63915:
URL: https://github.com/apache/airflow/pull/63915#discussion_r3004644274


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -1081,7 +1081,6 @@ async def get_pod_events(
                 if resource_version is not None:
                     kwargs["resource_version"] = resource_version
                     kwargs["resource_version_match"] = "NotOlderThan"
-

Review Comment:
   Can you please revert this changed line? Seems unrelated.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: re-discover succeeded pods in GKEJobTrigger to handle Kubernetes Job retries with XCom [airflow]

Posted by "Pranaykarvi (via GitHub)" <gi...@apache.org>.
Pranaykarvi commented on PR #63915:
URL: https://github.com/apache/airflow/pull/63915#issuecomment-4133804758

   Hi @SameerMesiah97, addressed all your review comments:
   
   - Replaced fallback `get_pod()` calls with a list comprehension over `current_pods`
   - Removed `run_in_executor` mock and re-initialized `GKEJobTrigger` block; using `job_trigger` fixture with `do_xcom_push = True` instead
   - Collapsed redundant `extract_xcom` asserts into `assert_called_once_with(succeeded_pod)`
   - Added `wait_until_container_complete` and `wait_until_container_started` assertions on `retry-succeeded-pod`
   - Added blank lines for readability
   
   All changes pass `ruff format` and `ruff check --fix`. Please take another look!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org