bitbake: cooker: Improve hash server startup code to avoid exit tracebacks

At exit the hashserv code was causing tracebacks as join() wasn't
being called from the thread that started the process. Ensure that
the hashserver is started from the pre_serve hook which is the
final thread the cooker runs in. This avoids the traceback at the
expense of some horrific poking into data stores which will ultimately
need improving through a proper API.

(Bitbake rev: 05888700e5f6cba48a26c8a4c447634a28e3baa6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2019-08-12 15:56:20 +01:00
parent abda938d66
commit 5f5bc81b3e
2 changed files with 18 additions and 12 deletions

View File

@@ -151,6 +151,7 @@ class ThreadedHTTPServer(HTTPServer):
signal.signal(signal.SIGTERM, self.sigterm_exception)
super().serve_forever()
os._exit(0)
def sigterm_exception(self, signum, stackframe):
self.server_close()