D3720: commandserver: close server's fds explicitly from a worker

quark (Jun Wu) phabricator at mercurial-scm.org
Tue Jun 12 19:42:57 UTC 2018


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The forked worker does not need to accept connections from the server's
  socket fd. So let's just close them explicitly to avoid surprises.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3720

AFFECTED FILES
  mercurial/commandserver.py

CHANGE DETAILS

diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -494,6 +494,8 @@
                     conn.close()  # release handle in parent process
             else:
                 try:
+                    selector.close()
+                    self._sock.close()
                     self._runworker(conn)
                     conn.close()
                     os._exit(0)



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list