From c9e5bb4fe8b23743f4e2a064395584c87d1232ba Mon Sep 17 00:00:00 2001 From: Stuart McLaren Date: Fri, 5 Sep 2014 13:04:31 +0000 Subject: [PATCH] Some tcp configuration paramters are ignored 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cinder/wsgi.py b/cinder/wsgi.py index fb9a9b8a2..70c46fd09 100644 --- a/cinder/wsgi.py +++ b/cinder/wsgi.py @@ -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(): -- 2.45.2