Skip to content

Commit e02be89

Browse files
committed
issue #625: ignore SIGINT within MuxProcess
Without this, MuxProcess will start dying too early, before Ansible / TaskQueueManager.cleanup() has a chance to wait on worker processes. That would allow WorkerProcess to see ECONNREFUSED from the MuxProcess socket much more easily.
1 parent 8a870f1 commit e02be89

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ansible_mitogen/process.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import os
3434
import resource
3535
import socket
36+
import signal
3637
import sys
3738

3839
try:
@@ -659,6 +660,12 @@ def worker_main(self):
659660
connected to the parent to be closed (indicating the parent has died).
660661
"""
661662
save_pid('mux')
663+
664+
# #623: MuxProcess ignores SIGINT because it wants to live until every
665+
# Ansible worker process has been cleaned up by
666+
# TaskQueueManager.cleanup(), otherwise harmles yet scary warnings
667+
# about being unable connect to MuxProess could be printed.
668+
signal.signal(signal.SIGINT, signal.SIG_IGN)
662669
ansible_mitogen.logging.set_process_name('mux')
663670
ansible_mitogen.affinity.policy.assign_muxprocess(self.index)
664671

0 commit comments

Comments
 (0)