Commit 761ce945 authored by Guido Trotter's avatar Guido Trotter
Browse files

Fork ganeti-noded

Create a new ForkingHTTPServer in ganeti-noded by deriving both from
NodeDaemonHttpServer and ForkingMixin. This will allow us to process
concurrent requests.

Reviewed-by: imsnah
parent a7399f66
......@@ -27,6 +27,7 @@
import os
import sys
import traceback
import SocketServer
import errno
import logging
......@@ -537,6 +538,15 @@ class NodeDaemonHttpServer(http.HTTPServer):
http.HTTPServer.__init__(self, server_address, NodeDaemonRequestHandler)
class ForkingHTTPServer(SocketServer.ForkingMixIn, NodeDaemonHttpServer):
"""Forking HTTP Server.
This inherits from ForkingMixIn and HTTPServer in order to fork for each
request we handle. This allows more requests to be handled concurrently.
"""
def ParseOptions():
"""Parse the command line options.
......@@ -603,7 +613,12 @@ def main():
global _EXIT_GANETI_NODED
httpd = NodeDaemonHttpServer(('', port))
if options.fork:
httpd = ForkingHTTPServer(('', port))
else:
httpd = NodeDaemonHttpServer(('', port))
# FIXME: updating _EXIT_GANETI_NODED doesn't work when forking
while (not _EXIT_GANETI_NODED):
httpd.handle_request()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment