Permalink
Browse files

Add wait for reactor. Debug if no matchmaker results. Comment out mat…

…chmaker contextmanager stuff, for now.
  • Loading branch information...
1 parent 9be14b5 commit 0fc3f6f09b34f99603a35b2022a4b1a879c66d59 Eric Windisch committed Apr 27, 2012
Showing with 25 additions and 15 deletions.
  1. +9 −0 nova/rpc/impl_zmq.py
  2. +16 −15 nova/rpc/matchmaker.py
View
@@ -428,6 +428,10 @@ def consume(self):
eventlet.spawn(self._procsocket, k)
)
+ def wait(self):
+ for t in self.threads:
+ t.wait()
+
def close(self):
for s in self.sockets:
s.close()
@@ -574,6 +578,11 @@ def _multi_send(style, context, topic, msg, socket_type=None, timeout=None):
LOG.debug(_("Sending message(s) to: %s") % matches)
+ # Don't stack if we have no matchmaker results
+ if len(matches) == 0:
+ LOG.debug(_("No matchmaker results. Not casting."))
+ return [style, topic, ['']]
+
# This supports brokerless fanout (addresses > 1)
for match in matches:
(l_style, l_context, l_topic) = match
View
@@ -142,19 +142,19 @@ def helper(*args, **kwargs):
return helper
-# Get a host on bare topics.
-# Not needed for ROUTER_PUB which is always brokered.
-@prettycontext #contextmanager
-def condbaretopic(style, context, topic):
- if '.' not in topic:
- print "foo!"
- yield
-
-with condbaretopic('a.a','b.d','cd'):
- print "hello world"
-
-with condbaretopic('a.a','b.d','c.d'):
- print "hello world"
+## Get a host on bare topics.
+## Not needed for ROUTER_PUB which is always brokered.
+#@prettycontext #contextmanager
+#def condbaretopic(style, context, topic):
+# if '.' not in topic:
+# print "foo!"
+# yield
+#
+#with condbaretopic('a.a','b.d','cd'):
+# print "hello world"
+#
+#with condbaretopic('a.a','b.d','c.d'):
+# print "hello world"
@prettycontext
@@ -227,8 +227,9 @@ def __init__(self):
super(MatchMakerRing, self).__init__() #*args, **kwargs)
# round-robin
- #self.add_condition(ConditionBareTopic(), NextTopicRule(), last=True)
- self.add_condition(condbaretopic, NextTopicRule(), last=True)
+ ##self.add_condition(ConditionBareTopic(), NextTopicRule(), last=True)
+ #self.add_condition(condbaretopic, NextTopicRule(), last=True)
+
# fanout messaging
self.add_condition(
[ConditionBareTopic(), ConditionFanout()],

0 comments on commit 0fc3f6f

Please sign in to comment.