Merge "Don't join the command thread if we stop via command socket"

This commit is contained in:
Zuul 2022-01-14 20:14:55 +00:00 committed by Gerrit Code Review
commit 3d07acb24e
1 changed files with 3 additions and 1 deletions

View File

@ -321,7 +321,9 @@ class Scheduler(threading.Thread):
self._command_running = False
self.log.debug("Stopping command socket")
self.command_socket.stop()
self.command_thread.join()
# If we stop from the command socket we cannot join the command thread.
if threading.current_thread() is not self.command_thread:
self.command_thread.join()
self.log.debug("Stopping timedb thread")
self.times.join()
self.log.debug("Stopping monitoring server")