Merge "[zmq] Remove ZmqSocket.close_linger attribute"

This commit is contained in:
Jenkins 2016-09-09 18:40:22 +00:00 committed by Gerrit Code Review
commit 6bbe8d1ac6
2 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ zmq_opts = [
help='Name of this node. Must be a valid hostname, FQDN, or '
'IP address. Must match "host" option, if running Nova.'),
cfg.IntOpt('rpc_zmq_linger', default=-1,
cfg.IntOpt('zmq_linger', default=-1,
deprecated_group='DEFAULT',
deprecated_name='rpc_cast_timeout',
help='Number of seconds to wait before all pending '

View File

@ -46,12 +46,12 @@ class ZmqSocket(object):
self.handle = context.socket(socket_type)
self.handle.set_hwm(high_watermark)
self.close_linger = -1
if self.conf.oslo_messaging_zmq.rpc_zmq_linger >= 0:
# Set linger period
linger = -1
if self.conf.oslo_messaging_zmq.zmq_linger >= 0:
# Convert seconds to milliseconds
self.close_linger = \
self.conf.oslo_messaging_zmq.rpc_zmq_linger * 1000
self.handle.setsockopt(zmq.LINGER, self.close_linger)
linger = self.conf.oslo_messaging_zmq.zmq_linger * 1000
self.handle.setsockopt(zmq.LINGER, linger)
# Put messages to only connected queues
self.handle.setsockopt(zmq.IMMEDIATE, 1 if immediate else 0)