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:
Jeff Bradberry 2020-06-04 14:19:46 -04:00
parent 7623257a6c
commit ced8f42835
2 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class WorkerSignalHandler:
def __init__(self):
self.kill_now = False
signal.signal(signal.SIGTERM, signal.SIG_DFL)
signal.signal(signal.SIGINT, self.exit_gracefully)
def exit_gracefully(self, *args, **kwargs):

View File

@ -581,3 +581,4 @@ class TaskManager():
logger.debug("Starting Scheduler")
with task_manager_bulk_reschedule():
self._schedule()
logger.debug("Finishing Scheduler")