Explorar o código

Join threads at shutdown. Related to issue #152

Ask Solem %!s(int64=14) %!d(string=hai) anos
pai
achega
db2b6643f4
Modificáronse 2 ficheiros con 2 adicións e 0 borrados
  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)