AutomationDev85 commented on code in PR #56875:
URL: https://github.com/apache/airflow/pull/56875#discussion_r2448004015
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -99,6 +101,92 @@ def check_exception_is_kubernetes_api_unauthorized(exc:
BaseException):
return isinstance(exc, ApiException) and exc.status and str(exc.status) ==
"401"
+async def generic_watch_pod_events(
+ self,
+ pod: V1Pod,
+ check_interval: float = 1,
+ is_async: bool = True,
+) -> None:
+ """Read pod events and writes into log."""
+ num_events = 0
+ while not self.stop_watching_events:
+ events = await self.read_pod_events(pod) if is_async else
self.read_pod_events(pod)
Review Comment:
This function is shared by both AsyncPodManager and PodManager. In one case,
it uses a synchronous API call; in the other, it uses an asynchronous call. The
function was originally introduced as async to allow the PodManager to read pod
events and track pod start behavior in parallel. However, when used with
PodManager, synchronous API calls are still performed.
--
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]