commandserver: close service fds after fork

Summary:
After `fork()`, the chg worker no longer needs to detect incoming
connections using the selector, or `accept()` a connection. So let's just
close those fds explicitly.

Reviewed By: phillco

Differential Revision: D8384549

fbshipit-source-id: 9bd43692a575d425b61da8ad9c6b069113b2ae4b
This commit is contained in:
Jun Wu 2018-06-13 19:06:17 -07:00 committed by Facebook Github Bot
parent e0f6443a40
commit 0a922c634d

View File

@ -526,6 +526,8 @@ class unixforkingservice(object):
conn.close() # release handle in parent process
else:
try:
selector.close()
self._sock.close()
self._runworker(conn)
conn.close()
os._exit(0)