mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Force worker processes to have a different signal handler from the parent
Situations have come up where the 5+ minute kill signal for run_task_manager is emitted to the worker process running it, but since the worker improperly inherited the AWXConsumerBase().stop() handler a deadlock ultimately was triggered on the database connection.
This commit is contained in:
@@ -35,6 +35,7 @@ class WorkerSignalHandler:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.kill_now = False
|
self.kill_now = False
|
||||||
|
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
||||||
signal.signal(signal.SIGINT, self.exit_gracefully)
|
signal.signal(signal.SIGINT, self.exit_gracefully)
|
||||||
|
|
||||||
def exit_gracefully(self, *args, **kwargs):
|
def exit_gracefully(self, *args, **kwargs):
|
||||||
|
|||||||
@@ -581,3 +581,4 @@ class TaskManager():
|
|||||||
logger.debug("Starting Scheduler")
|
logger.debug("Starting Scheduler")
|
||||||
with task_manager_bulk_reschedule():
|
with task_manager_bulk_reschedule():
|
||||||
self._schedule()
|
self._schedule()
|
||||||
|
logger.debug("Finishing Scheduler")
|
||||||
|
|||||||
Reference in New Issue
Block a user