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


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -147,6 +152,33 @@ def create_job(self, job_request_obj: k8s.V1Job) -> 
k8s.V1Job:
 
         return job_request_obj
 
+    def get_or_create_pod(self, pod_request_obj, context):
+        """Polls for pods created by the job object
+
+        Parameters
+        ----------
+        pod_request_obj : V1Pod
+            Kubernetes Pod object definition
+        context : Context
+            Airflow context
+
+        Returns
+        -------
+        V1Pod
+            Kubernetes Pod object from cluster hook
+        """
+        pod = None
+        with timeout(seconds=self.pod_creation_timeout, 
error_message="Exceeded pod_creation_timeout."):
+            while pod is None:
+                try:
+                    pod = self.find_pod(self.namespace or 
pod_request_obj.metadata.namespace, context=context)
+                except ApiException:
+                    log.exception("Error getting pod - retrying")
+                    time.sleep(1)

Review Comment:
   added `pod_poll_interval` parameter to configure this



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