Parcourir la source

Join threads at shutdown. Related to issue #152

Ask Solem il y a 14 ans
Parent
commit
db2b6643f4
2 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 1 0
      celery/worker/controllers.py
  2. 1 0
      celery/worker/heartbeat.py

+ 1 - 0
celery/worker/controllers.py

@@ -60,6 +60,7 @@ class BackgroundThread(threading.Thread):
         self.on_stop()
         self._shutdown.set()
         self._stopped.wait() # block until this thread is done
+        self.join(1e100)
 
 
 class Mediator(BackgroundThread):

+ 1 - 0
celery/worker/heartbeat.py

@@ -58,3 +58,4 @@ class Heart(threading.Thread):
         self._state = "CLOSE"
         self._shutdown.set()
         self._stopped.wait() # block until this thread is done
+        self.join(1e100)