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

Re: [PR] remove references to KubernetesJobOperator.get_or_create_pod() to fix creating duplicate pods [airflow]

stephen-bracken commented on code in PR #53368:
URL: https://github.com/apache/airflow/pull/53368#discussion_r2657429368


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -461,7 +452,9 @@ def get_pods(
         pod_list: Sequence[k8s.V1Pod] = []
         retry_number: int = 0
 
-        while len(pod_list) != self.parallelism or retry_number <= self.discover_pods_retry_number:
+        while retry_number <= self.discover_pods_retry_number:
+            if len(pod_list) == self.parallelism:
+                break
             pod_list = self.client.list_namespaced_pod(
                 namespace=pod_request_obj.metadata.namespace,
                 label_selector=label_selector,

Review Comment:
   This is out of scope for this PR.



-- 
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