kpathak13 commented on a change in pull request #6237: AIRFLOW-5581: Join
KubernetesJobWatcher in terminate call and unblock queues from blocking forever
URL: https://github.com/apache/airflow/pull/6237#discussion_r331942935
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -572,9 +572,28 @@ def _labels_to_key(self, labels):
)
return None
+ def _flush_watcher_queue(self):
+ self.log.debug('Executor shutting down, watcher_queue approx.
size=%d', self.watcher_queue.qsize())
+ while True:
+ try:
+ task = self.watcher_queue.get_nowait()
+ # Ignoring it since it can only have either FAILED or
SUCCEEDED pods
+ self.log.warning('Executor shutting down, IGNORING watcher
task=%s', task)
+ self.watcher_queue.task_done()
+ except Empty:
+ break
+
def terminate(self):
"""Termninates the watcher."""
+ self.log.debug("Terminating kube_watcher...")
+ self.kube_watcher.terminate()
+ self.kube_watcher.join()
+ self.log.debug("kube_watcher=%s alive?=%s", self.kube_watcher,
self.kube_watcher.is_alive())
Review comment:
Removed `is alive?` and rebased.
----------------------------------------------------------------
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