changeset 35461:3a119a423953

commandserver: unblock SIGCHLD This enables the SIGCHLD handler to work properly if some buggy program started chg server with SIGCHLD blocked. A test of this probably requires C code, but we don't have such kind of tests already. Since this is a simple and clear fix, I'm leaving it as "untested" but I did a manual test and there were no longer zombie workers. Differential Revision: https://phab.mercurial-scm.org/D1737
author Jun Wu <quark@fb.com>
date Wed, 20 Dec 2017 11:35:38 -0800
parents 8652ab4046e4
children 6f754b0fe54e
files mercurial/commandserver.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commandserver.py	Wed Dec 20 02:13:35 2017 -0800
+++ b/mercurial/commandserver.py	Wed Dec 20 11:35:38 2017 -0800
@@ -449,6 +449,8 @@
     def init(self):
         self._sock = socket.socket(socket.AF_UNIX)
         self._servicehandler.bindsocket(self._sock, self.address)
+        if util.safehasattr(util, 'unblocksignal'):
+            util.unblocksignal(signal.SIGCHLD)
         o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
         self._oldsigchldhandler = o
         self._socketunlinked = False