Join command thread on exit

The executor and fingergw miss joining the command thread. This could
lead to random test failures like [1].

[1] Trace:
Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/zuul/zuul/tests/base.py", line 4187, in shutdown
    raise Exception("More than one thread is running: %s" % threads)
Exception: More than one thread is running:
[<_MainThread(MainThread, started 140602311071488)>, <Thread(command, started daemon 140601232180992)>]

Change-Id: I5246b686fe708444ffaf9d94ef4321b304f1754e
This commit is contained in:
Tobias Henkel 2020-07-07 21:35:08 +02:00
parent 88a7f8d47e
commit 545bb19459
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
2 changed files with 4 additions and 0 deletions

View File

@ -2801,6 +2801,7 @@ class ExecutorServer(BaseMergeServer):
if self.process_merge_jobs:
super().join()
self.executor_gearworker.join()
self.command_thread.join()
def pause(self):
self.log.debug('Pausing')

View File

@ -217,3 +217,6 @@ class FingerGateway(object):
Wait on the gateway to shutdown.
'''
self.server_thread.join()
if self.command_thread:
self.command_thread.join()