From efab451632e44ee0789d417c092df0880ce6cc71 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 4 Sep 2014 09:57:42 -0400 Subject: [PATCH] Fix an issue where I wasn't reattaching the signal handlers to the child worker processes when they were restarted --- awx/main/management/commands/run_callback_receiver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/management/commands/run_callback_receiver.py b/awx/main/management/commands/run_callback_receiver.py index b2ee842749..a73983b917 100644 --- a/awx/main/management/commands/run_callback_receiver.py +++ b/awx/main/management/commands/run_callback_receiver.py @@ -28,7 +28,7 @@ from awx.main.models import * # ZeroMQ import zmq -MAX_REQUESTS = 20000 +MAX_REQUESTS = 10000 WORKERS = 4 class CallbackReceiver(object): @@ -122,6 +122,10 @@ class CallbackReceiver(object): w = Process(target=self.callback_worker, args=(queue_actual_worker[1],)) w.daemon = True w.start() + + signal.signal(signal.SIGINT, shutdown_handler([w])) + signal.signal(signal.SIGTERM, shutdown_handler([w])) + queue_actual_worker[2] = w last_parent_events[message['job_id']] = job_parent_events consumer_subscriber.send("1")