From a4049296d9a343757c01fa3f3d32d70a0db77ab1 Mon Sep 17 00:00:00 2001 From: XavierDo Date: Fri, 15 Mar 2019 13:19:35 +0000 Subject: [PATCH] [IMP] core: avoid to process work when worker is 'killed' during sleep. If a signal is received during the worker _runloop sleep, the worker will be marked as alive=False but process_work will still be called once. This commit prevents that by checking the worker state before calling process_work. closes odoo/odoo#31885 Signed-off-by: Olivier Dony (odo) --- odoo/service/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/service/server.py b/odoo/service/server.py index 60392d25b10..aca5fa60e3a 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -763,6 +763,8 @@ class Worker(object): while self.alive: self.multi.pipe_ping(self.watchdog_pipe) self.sleep() + if not self.alive: + break self.process_work() self.check_limits() except: