[zmq] Rename rpc_cast_timeout option
This patch renames the rpc_cast_timeout option, because it is missleading and actually is only used as zmq.LINGER socket option. Change-Id: Ia7b6fc1213280e93940b34b087ce0e3672d50304
This commit is contained in:
parent
dbcd48a8ea
commit
c2e5645e8c
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user