hussein-awala commented on code in PR #40909:
URL: https://github.com/apache/airflow/pull/40909#discussion_r1702863969
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -721,14 +721,27 @@ def read_pod(self, pod: V1Pod) -> V1Pod:
except HTTPError as e:
raise AirflowException(f"There was an error reading the kubernetes
API: {e}")
- def await_xcom_sidecar_container_start(self, pod: V1Pod) -> None:
+ def await_xcom_sidecar_container_start(self, pod: V1Pod, startup_timeout:
int = 120) -> None:
+ """
+ Await xcom sidecar container to start running.
+
+ :param pod:
+ :param startup_timeout: Timeout (in seconds) for startup of the pod
+ """
self.log.info("Checking if xcom sidecar container is started.")
+ curr_time = time.time()
Review Comment:
```suggestion
start_time = time.time()
```
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -721,14 +721,27 @@ def read_pod(self, pod: V1Pod) -> V1Pod:
except HTTPError as e:
raise AirflowException(f"There was an error reading the kubernetes
API: {e}")
- def await_xcom_sidecar_container_start(self, pod: V1Pod) -> None:
+ def await_xcom_sidecar_container_start(self, pod: V1Pod, startup_timeout:
int = 120) -> None:
+ """
+ Await xcom sidecar container to start running.
+
+ :param pod:
+ :param startup_timeout: Timeout (in seconds) for startup of the pod
+ """
self.log.info("Checking if xcom sidecar container is started.")
+ curr_time = time.time()
for attempt in itertools.count():
if self.container_is_running(pod,
PodDefaults.SIDECAR_CONTAINER_NAME):
self.log.info("The xcom sidecar container is started.")
break
if not attempt:
self.log.warning("The xcom sidecar container is not yet
started.")
+ if time.time() - curr_time >= startup_timeout:
Review Comment:
```suggestion
if time.time() - start_time >= startup_timeout:
```
--
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]