milton0825 commented on a change in pull request #5200: [AIRFLOW-4401] Use
managers for Queue synchronization
URL: https://github.com/apache/airflow/pull/5200#discussion_r279630533
##########
File path: airflow/contrib/executors/kubernetes_executor.py
##########
@@ -440,11 +443,18 @@ def sync(self):
"""
self._health_check_kube_watcher()
- while not self.watcher_queue.empty():
- self.process_watcher_task()
-
- def process_watcher_task(self):
- pod_id, state, labels, resource_version = self.watcher_queue.get()
+ while True:
+ try:
+ task = self.watcher_queue.get_nowait()
+ try:
+ self.process_watcher_task(task)
+ finally:
+ self.watcher_queue.task_done()
+ except queue.Empty:
Review comment:
```suggestion
except Empty:
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services