diff options
author | Alan Conway <aconway@apache.org> | 2010-07-05 20:12:08 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-07-05 20:12:08 +0000 |
commit | 74f973f9b8aaa0aedc9e7c3b2505357aae8e614a (patch) | |
tree | 8ad8de6773a48aab5121ac4152fb8624758b5087 /python/qpid/brokertest.py | |
parent | 3c57e4b18865b717404ea41efbd4b80516a92a33 (diff) | |
download | qpid-python-74f973f9b8aaa0aedc9e7c3b2505357aae8e614a.tar.gz |
Defer delivery of messages in cluster-unsafe context.
Messages enqueued in a cluster-safe context are synchronized across
the cluster. However some messages are delivered in a cluster-unsafe
context, for example raising a link established event occurs the
connection thread of the establishing connection.
This fix deferrs such messages by multicasting them so they can be
re-delived in a cluster safe context.
See https://bugzilla.redhat.com/show_bug.cgi?id=611543
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@960681 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/brokertest.py')
-rw-r--r-- | python/qpid/brokertest.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py index 011254d21d..5473bd588e 100644 --- a/python/qpid/brokertest.py +++ b/python/qpid/brokertest.py @@ -251,6 +251,12 @@ def checkenv(name): if not value: raise Exception("Environment variable %s is not set" % name) return value +def find_in_file(str, filename): + if not os.path.exists(filename): return False + f = open(filename) + try: return str in f.read() + finally: f.close() + class Broker(Popen): "A broker process. Takes care of start, stop and logging." _broker_count = 0 @@ -367,15 +373,7 @@ class Broker(Popen): def log_ready(self): """Return true if the log file exists and contains a broker ready message""" if self._log_ready: return True - if not os.path.exists(self.log): return False - f = open(self.log) - try: - for l in f: - if "notice Broker running" in l: - self._log_ready = True - return True - return False - finally: f.close() + self._log_ready = find_in_file("notice Broker running", self.log) def ready(self, **kwargs): """Wait till broker is ready to serve clients""" |