Skip to content
Snippets Groups Projects
Commit bcb1a39e authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

ganeti-noded: Close listening socket in child


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d87e1814
No related branches found
No related tags found
No related merge requests found
......@@ -522,6 +522,16 @@ class HttpServer(http.HttpBase, asyncore.dispatcher):
if pid == 0:
# Child process
try:
# The client shouldn't keep the listening socket open. If the parent
# process is restarted, it would fail when there's already something
# listening (in this case its own child from a previous run) on the
# same port.
try:
self.socket.close()
except socket.error:
pass
self.socket = None
self.request_executor(self, connection, client_addr)
except Exception:
logging.exception("Error while handling request from %s:%s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment