dstandish commented on code in PR #53475:
URL: https://github.com/apache/airflow/pull/53475#discussion_r2219976785


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -380,9 +381,8 @@ def create_pod(self, pod: V1Pod) -> V1Pod:
 
     async def watch_pod_events(self, pod: V1Pod, check_interval: int = 1) -> 
None:
         """Read pod events and writes into log."""
-        self.keep_watching_for_events = True
         num_events = 0
-        while self.keep_watching_for_events:
+        while not self.stop_watching_events:
             events = self.read_pod_events(pod)

Review Comment:
   @jedcunningham you might find this interesting. 
   
   there was actually a race condition here.
   
   i found in the system tests that if await_pod_start ran first, then 
watch_pod_events would _set keep_watching_for_events back to true_ and nothing 
would ever set it false.
   
   so these subtle changes ensure that once it is set to stop, it will stay 
that way.



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