summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-12 20:11:31 +0000
committerAlan Conway <aconway@apache.org>2010-03-12 20:11:31 +0000
commitd5a1fa6cf3b9c349074b53609e0c4c383c21979d (patch)
treefa3b0b244bb4cb99deaa2ec8d645454b1f33183c /qpid/python
parente0103f85b3e8f1bb40d0808e725710c9e9f8fd73 (diff)
downloadqpid-python-d5a1fa6cf3b9c349074b53609e0c4c383c21979d.tar.gz
New cluster member pushes store when joining an active cluster.
Previously a broker with a clean store would not be able to join an active cluster because the shtudown-id did not match. This commit ensures that when a broker joins an active cluster, it always pushes its store regardless of status. Clean/dirty status is only compared when forming an initial cluster. This change required splitting initialization into two phases: PRE_INIT: occurs in the Cluster ctor during early-initialize. This phase determines whether or not to push the store. INIT: occurs after Cluster::initialize and does the remaining initialization chores. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@922412 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/brokertest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/qpid/python/qpid/brokertest.py b/qpid/python/qpid/brokertest.py
index 500d41f85d..26b46ad468 100644
--- a/qpid/python/qpid/brokertest.py
+++ b/qpid/python/qpid/brokertest.py
@@ -268,6 +268,7 @@ class Broker(Popen):
test.cleanup_stop(self)
self._host = "localhost"
log.debug("Started broker %s (%s, %s)" % (self.name, self.pname, self.log))
+ self._log_ready = False
def host(self): return self._host
@@ -343,12 +344,14 @@ 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
- ready_msg = re.compile("notice Broker running")
f = file(self.log)
try:
for l in f:
- if ready_msg.search(l): return True
+ if "notice Broker running" in l:
+ self._log_ready = True
+ return True
return False
finally: f.close()
@@ -445,7 +448,7 @@ class BrokerTest(TestCase):
if (wait):
try: b.ready()
except Exception, e:
- raise Exception("Failed to start broker %s: %s" % ( b.name, e))
+ raise Exception("Failed to start broker %s(%s): %s" % (b.name, b.log, e))
return b
def cluster(self, count=0, args=[], expect=EXPECT_RUNNING, wait=True):