diff --git a/cinder/wsgi.py b/cinder/wsgi.py index a7cfbcb495d..ff4b2d54578 100644 --- a/cinder/wsgi.py +++ b/cinder/wsgi.py @@ -84,6 +84,11 @@ eventlet_opts = [ "If an incoming connection is idle for this number of " "seconds it will be closed. A value of \'0\' means " "wait forever."), + cfg.BoolOpt('wsgi_keep_alive', + default=True, + help='If False, closes the client socket connection ' + 'explicitly. Setting it to True to maintain backward ' + 'compatibility. Recommended setting is set it to False.'), ] CONF = cfg.CONF @@ -236,7 +241,8 @@ class Server(object): 'protocol': self._protocol, 'custom_pool': self._pool, 'log': self._wsgi_logger, - 'socket_timeout': self.client_socket_timeout + 'socket_timeout': self.client_socket_timeout, + 'keepalive': CONF.wsgi_keep_alive } self._server = eventlet.spawn(**wsgi_kwargs) diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index 656393c76ff..6665e30cef7 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -311,6 +311,11 @@ # value) #client_socket_timeout=900 +# If False, closes the client socket connection explicitly. +# Setting it to True to maintain backward compatibility. +# Recommended setting is set it to False. (boolean value) +#wsgi_keep_alive=true + # Sets the value of TCP_KEEPALIVE (True/False) for each server # socket. (boolean value) #tcp_keepalive=true