Ver código fonte

Join threads at shutdown. Related to issue #152

Ask Solem 14 anos atrás
pai
commit
db2b6643f4
2 arquivos alterados com 2 adições e 0 exclusões
  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)