[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) <odo@openerp.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user