You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/10/07 08:38:51 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6237: AIRFLOW-5581: Join KubernetesJobWatcher in terminate call and unblock queues from blocking forever

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

 ##########
 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:
   This isn't useful - after a call to `.join()` the kube_watcher should never be alive, right?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services