From 19fa52d51db380dc6fd46a02cf447e67c02917f8 Mon Sep 17 00:00:00 2001 From: Diego Santa Cruz Date: Tue, 2 Feb 2016 13:05:50 +0100 Subject: [PATCH] bitbake: prserv: SIGTERM handling hung process The current SIGTERM handler hungs the process instead of making it exit. The problem seems to be that the handler thread is not signaled to quit, so it stays there doing its work, as it is not a daemon thread. Setting the quit variable fixes this. While at it, to not use the SystemExit exception to terminate upon SIGTERM but instead left the quit flag do its job. This way the PID file is properly removed. Signed-off-by: Diego Santa Cruz --- bitbake/lib/prserv/serv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py index c65dd3c..1de37cf 100644 --- a/bitbake/lib/prserv/serv.py +++ b/bitbake/lib/prserv/serv.py @@ -101,7 +101,7 @@ class PRServer(SimpleXMLRPCServer): def sigterm_handler(self, signum, stack): if self.table: self.table.sync() - raise SystemExit + self.quit=True def process_request(self, request, client_address): self.requestqueue.put((request, client_address)) -- 1.9.4