]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Some tcp configuration paramters are ignored
authorStuart McLaren <stuart.mclaren@hp.com>
Fri, 5 Sep 2014 13:04:31 +0000 (13:04 +0000)
committerStuart McLaren <stuart.mclaren@hp.com>
Fri, 5 Sep 2014 13:13:02 +0000 (13:13 +0000)
The values for tcp_keepalive, tcp_keepidle, tcp_keepalive_count and
tcp_keepalive_interval in cinder.conf are not being picked up.

Change-Id: Ie0a232ae6b9b9a34d57b48f3b0d8694f90504517
Closes-bug: #1366011

cinder/wsgi.py

index fb9a9b8a2e48ce044178c5b00040d96a3e67de8d..70c46fd097d9ad53112fc405a57565b6d4cfb9cd 100644 (file)
@@ -39,6 +39,7 @@ from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
+from cinder.openstack.common import network_utils
 from cinder import utils
 
 
@@ -210,8 +211,11 @@ class Server(object):
                                       socket.SO_REUSEADDR, 1)
 
                 # sockets can hang around forever without keepalive
-                dup_socket.setsockopt(socket.SOL_SOCKET,
-                                      socket.SO_KEEPALIVE, 1)
+                network_utils.set_tcp_keepalive(dup_socket,
+                                                CONF.tcp_keepalive,
+                                                CONF.tcp_keepidle,
+                                                CONF.tcp_keepalive_count,
+                                                CONF.tcp_keepalive_interval)
 
             except Exception:
                 with excutils.save_and_reraise_exception():