uranusjr commented on code in PR #33977:
URL: https://github.com/apache/airflow/pull/33977#discussion_r1312606420


##########
airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py:
##########
@@ -354,8 +355,8 @@ def sync(self) -> None:
         self.kube_scheduler.sync()
 
         last_resource_version: dict[str, str] = defaultdict(lambda: "0")
-        while True:
-            try:
+        with contextlib.suppress(Empty):

Review Comment:
   `Empty` should be raised by `queue.get_nowait()`, so previously this would 
be caught by the exception block to break the loop. Now `Empty` would be raised 
and break out of the loop, and then suppressed by this context manager. The end 
result should be the same.



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