changeset 38291:c07424ec633c

commandserver: close server's fds explicitly from a worker 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. Differential Revision: https://phab.mercurial-scm.org/D3720
author Jun Wu <quark@fb.com>
date Tue, 12 Jun 2018 12:41:09 -0700
parents b5651ae53127
children 9f56ad50924d
files mercurial/commandserver.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commandserver.py	Tue Jun 12 23:04:27 2018 +0200
+++ b/mercurial/commandserver.py	Tue Jun 12 12:41:09 2018 -0700
@@ -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)