mirror of
https://git.yoctoproject.org/poky
synced 2026-06-04 02:00:04 +00:00
bitbake: prserv/serv: Send sentinel to stop handler thread
Shutdown from SIGTERM currently has to wait for the handler thread to timeout. Add a sentinel value which triggers it to loop and allows for a quick exit. (Bitbake rev: a7591ef34ce70ff1d7aa9362d7473e6f16fbd10f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -84,6 +84,8 @@ class PRServer(SimpleXMLRPCServer):
|
||||
except queue.Empty:
|
||||
self.table.sync_if_dirty()
|
||||
continue
|
||||
if request is None:
|
||||
continue
|
||||
try:
|
||||
self.finish_request(request, client_address)
|
||||
self.shutdown_request(request)
|
||||
@@ -103,7 +105,8 @@ class PRServer(SimpleXMLRPCServer):
|
||||
def sigterm_handler(self, signum, stack):
|
||||
if self.table:
|
||||
self.table.sync()
|
||||
self.quit=True
|
||||
self.quit()
|
||||
self.requestqueue.put((None, None))
|
||||
|
||||
def process_request(self, request, client_address):
|
||||
self.requestqueue.put((request, client_address))
|
||||
|
||||
Reference in New Issue
Block a user