dstandish commented on code in PR #25055:
URL: https://github.com/apache/airflow/pull/25055#discussion_r923587572
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -354,8 +354,19 @@ def read_pod(self, pod: V1Pod) -> V1Pod:
except BaseHTTPError as e:
raise AirflowException(f'There was an error reading the kubernetes
API: {e}')
+ def await_xcom_sidecar_container_start(self, pod: V1Pod) -> None:
+ while True:
+ self.log.info("Checking if xcom sidecar container is started.")
+ if self.container_is_running(pod,
PodDefaults.SIDECAR_CONTAINER_NAME):
+ self.log.warning("The xcom sidecar container is started.")
+ break
+ self.log.warning("The xcom sidecar container is not yet started.")
+ time.sleep(1)
+
def extract_xcom(self, pod: V1Pod) -> str:
"""Retrieves XCom value and kills xcom sidecar container"""
+ self.await_xcom_sidecar_container_start(pod)
Review Comment:
i would not put this in `extract_xcom` -- i think it's better if
`extract_xcom` does not wait, but just extracts; it can be called independently
in KPO -- WDYT?
--
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]