comparison mercurial/commandserver.py @ 40828:25e9089c7686

commandserver: turn server debug messages into logs They were ui.debug() just because commandserver.log() was noop if no client connected.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Nov 2018 19:55:53 +0900
parents d23fd01cc115
children e7110f44ee2d
comparison
equal deleted inserted replaced
40827:d23fd01cc115 40828:25e9089c7686
571 raise 571 raise
572 572
573 pid = os.fork() 573 pid = os.fork()
574 if pid: 574 if pid:
575 try: 575 try:
576 self.ui.debug('forked worker process (pid=%d)\n' % pid) 576 self.ui.log(b'cmdserver',
577 b'forked worker process (pid=%d)\n', pid)
577 self._workerpids.add(pid) 578 self._workerpids.add(pid)
578 h.newconnection() 579 h.newconnection()
579 finally: 580 finally:
580 conn.close() # release handle in parent process 581 conn.close() # release handle in parent process
581 else: 582 else:
608 self._workerpids.clear() 609 self._workerpids.clear()
609 return 610 return
610 if pid == 0: 611 if pid == 0:
611 # no waitable child processes 612 # no waitable child processes
612 return 613 return
613 self.ui.debug('worker process exited (pid=%d)\n' % pid) 614 self.ui.log(b'cmdserver', b'worker process exited (pid=%d)\n', pid)
614 self._workerpids.discard(pid) 615 self._workerpids.discard(pid)
615 616
616 def _runworker(self, conn): 617 def _runworker(self, conn):
617 signal.signal(signal.SIGCHLD, self._oldsigchldhandler) 618 signal.signal(signal.SIGCHLD, self._oldsigchldhandler)
618 _initworkerprocess() 619 _initworkerprocess()