[PATCH 4 of 4 stateful-chg] commandserver: allow service to process handler's heartbeat result

Jun Wu quark at fb.com
Sat May 6 19:39:17 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1493533827 25200
#      Sat Apr 29 23:30:27 2017 -0700
# Node ID e5de933e2325dcc8bbaeab17c91b08c203afbdf8
# Parent  ba6bc72d245d779c8951d50eddca1bea9b1b802a
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r e5de933e2325
commandserver: allow service to process handler's heartbeat result

This will be useful for chg where chg handler could tell service to replace
its socket.

diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -491,5 +491,5 @@ class unixforkingservice(object):
                 exiting = True
             else:
-                h.heartbeat()
+                self._handleheartbeat(h.heartbeat())
             try:
                 ready = select.select([self._sock], [], [], h.pollinterval)[0]
@@ -524,4 +524,7 @@ class unixforkingservice(object):
                         os._exit(255)
 
+    def _handleheartbeat(self, value):
+        pass
+
     def _sigchldhandler(self, signal, frame):
         self._reapworkers(os.WNOHANG)


More information about the Mercurial-devel mailing list