diff options
| author | Alan Conway <aconway@apache.org> | 2010-03-12 20:11:31 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-03-12 20:11:31 +0000 |
| commit | ef9268528d3147173dfb0d2ef707ee3e4fc4f210 (patch) | |
| tree | 4d8a9851683812bd04392f57c695a5143c80ca79 /python | |
| parent | 937fe6e7295efff28cb680642fca28ebf65e7d4e (diff) | |
| download | qpid-python-ef9268528d3147173dfb0d2ef707ee3e4fc4f210.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/qpid@922412 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/brokertest.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py index 500d41f85d..26b46ad468 100644 --- a/python/qpid/brokertest.py +++ b/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): |
