[zmq] Don't fallback to topic if wrong server specified
When target is specified with server name the correct result is empty if there is no records with this precise name registered. Change-Id: Ibaa7c23c633ccc5f2ca428deb022c9fc1d00e8e7
This commit is contained in:
parent
1121a6bb60
commit
c9732d5d3b
@ -70,7 +70,7 @@ class RoutingTableAdaptor(object):
|
|||||||
if not self.routing_table.contains(target_key):
|
if not self.routing_table.contains(target_key):
|
||||||
LOG.debug("Target %s is not in cache. Check matchmaker server."
|
LOG.debug("Target %s is not in cache. Check matchmaker server."
|
||||||
% target_key)
|
% target_key)
|
||||||
hosts = self.matchmaker.get_hosts_fanout_retry(
|
hosts = self.matchmaker.get_hosts_fanout(
|
||||||
target, zmq_names.socket_type_str(self.listener_type))
|
target, zmq_names.socket_type_str(self.listener_type))
|
||||||
LOG.debug("Received hosts %s" % hosts)
|
LOG.debug("Received hosts %s" % hosts)
|
||||||
self.routing_table.update_hosts(target_key, hosts)
|
self.routing_table.update_hosts(target_key, hosts)
|
||||||
@ -174,9 +174,6 @@ class RoutingTableUpdater(zmq_updater.UpdaterBase):
|
|||||||
try:
|
try:
|
||||||
for target_key in target_keys:
|
for target_key in target_keys:
|
||||||
hosts = self.matchmaker.get_hosts_by_key(target_key)
|
hosts = self.matchmaker.get_hosts_by_key(target_key)
|
||||||
if not hosts:
|
|
||||||
LOG.warning(_LW("Target %s has been removed") % target_key)
|
|
||||||
else:
|
|
||||||
self.routing_table.update_hosts(target_key, hosts)
|
self.routing_table.update_hosts(target_key, hosts)
|
||||||
LOG.debug("Updating routing table from the matchmaker. "
|
LOG.debug("Updating routing table from the matchmaker. "
|
||||||
"%d target(s) updated %s." % (len(target_keys),
|
"%d target(s) updated %s." % (len(target_keys),
|
||||||
|
@ -214,8 +214,7 @@ class MatchmakerRedisBase(zmq_matchmaker_base.MatchmakerBase):
|
|||||||
if target.server:
|
if target.server:
|
||||||
key = zmq_address.target_to_key(target, listener_type)
|
key = zmq_address.target_to_key(target, listener_type)
|
||||||
hosts.extend(self._smembers(key))
|
hosts.extend(self._smembers(key))
|
||||||
|
else:
|
||||||
if not hosts:
|
|
||||||
key = zmq_address.prefix_str(target.topic, listener_type)
|
key = zmq_address.prefix_str(target.topic, listener_type)
|
||||||
hosts.extend(self._smembers(key))
|
hosts.extend(self._smembers(key))
|
||||||
|
|
||||||
|
@ -34,7 +34,9 @@ def prefix_str(key, listener_type):
|
|||||||
def target_to_key(target, listener_type=None):
|
def target_to_key(target, listener_type=None):
|
||||||
key = target.topic
|
key = target.topic
|
||||||
if target.server:
|
if target.server:
|
||||||
key += "/" + target.server
|
# FIXME(ozamiatin): Workaround for Cinder.
|
||||||
|
# Remove split when Bug #1630975 is being fixed.
|
||||||
|
key += "/" + target.server.split('@')[0]
|
||||||
return prefix_str(key, listener_type) if listener_type else key
|
return prefix_str(key, listener_type) if listener_type else key
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ zmq_opts = [
|
|||||||
'after which it is not tracked anymore by a '
|
'after which it is not tracked anymore by a '
|
||||||
'client/server.'),
|
'client/server.'),
|
||||||
|
|
||||||
cfg.BoolOpt('rpc_use_acks', default=True,
|
cfg.BoolOpt('rpc_use_acks', default=False,
|
||||||
help='Wait for message acknowledgements from receivers. '
|
help='Wait for message acknowledgements from receivers. '
|
||||||
'This mechanism works only via proxy without PUB/SUB.'),
|
'This mechanism works only via proxy without PUB/SUB.'),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user