Merge "[zmq] Rename rpc_cast_timeout option"

This commit is contained in:
Jenkins 2016-09-07 05:56:35 +00:00 committed by Gerrit Code Review
commit 4169807bf3
2 changed files with 9 additions and 5 deletions
oslo_messaging/_drivers/zmq_driver

@ -56,13 +56,16 @@ 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_cast_timeout', default=-1,
cfg.IntOpt('rpc_zmq_linger', default=-1,
deprecated_group='DEFAULT',
help='Seconds to wait before a cast expires (TTL). '
deprecated_name='rpc_cast_timeout',
help='Number of seconds to wait before all pending '
'messages will be sent after closing a socket. '
'The default value of -1 specifies an infinite linger '
'period. The value of 0 specifies no linger period. '
'Pending messages shall be discarded immediately '
'when the socket is closed. Only supported by impl_zmq.'),
'when the socket is closed. Positive values specify an '
'upper bound for the linger period.'),
cfg.IntOpt('rpc_poll_timeout', default=1,
deprecated_group='DEFAULT',

@ -47,9 +47,10 @@ class ZmqSocket(object):
self.handle.set_hwm(high_watermark)
self.close_linger = -1
if self.conf.oslo_messaging_zmq.rpc_cast_timeout > 0:
if self.conf.oslo_messaging_zmq.rpc_zmq_linger >= 0:
# Convert seconds to milliseconds
self.close_linger = \
self.conf.oslo_messaging_zmq.rpc_cast_timeout * 1000
self.conf.oslo_messaging_zmq.rpc_zmq_linger * 1000
self.handle.setsockopt(zmq.LINGER, self.close_linger)
# Put messages to only connected queues
self.handle.setsockopt(zmq.IMMEDIATE, 1 if immediate else 0)