Dinghang commented on code in PR #26639:
URL: https://github.com/apache/airflow/pull/26639#discussion_r1052930708
##########
airflow/executors/kubernetes_executor.py:
##########
@@ -370,7 +416,17 @@ def sync(self) -> None:
"""
self.log.debug("Syncing KubernetesExecutor")
self._health_check_kube_watcher()
- while True:
+
+ multi_threads_queue_process(
+ queue_size=self.watcher_queue.qsize(),
+ queue_type='watcher',
+ process_method=self.process_watcher_queue,
Review Comment:
Hi @dstandish , not sure what you meant network calls here. Here,
process_watcher_queue is just a method to process items in the watcher queue.
##########
airflow/executors/kubernetes_executor.py:
##########
@@ -599,8 +655,31 @@ def sync(self) -> None:
raise AirflowException(NOT_STARTED_MESSAGE)
self.kube_scheduler.sync()
- last_resource_version = None
- while True:
+ """processing result queue"""
+ multi_threads_queue_process(
+ queue_size=self.result_queue.qsize(),
+ queue_type='result',
+ process_method=self.process_result_queue,
Review Comment:
Hi @hterik , that's a good point! both self.running and self.event_buffer
are doing some atomic operations. AFAIK, they are thread-safe.
##########
airflow/executors/kubernetes_executor.py:
##########
@@ -370,7 +416,17 @@ def sync(self) -> None:
"""
self.log.debug("Syncing KubernetesExecutor")
self._health_check_kube_watcher()
- while True:
+
+ multi_threads_queue_process(
+ queue_size=self.watcher_queue.qsize(),
+ queue_type='watcher',
+ process_method=self.process_watcher_queue,
Review Comment:
Hi @dstandish , sorry for the late reply. Was AFK due to some personal
issues. Just got back. Will be addressing comments accordingly. Gonna ping you
again once it's ready.
--
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]