diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2009-07-31 16:52:59 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2009-07-31 16:52:59 +0000 |
| commit | d4408a59e892bd66cd17ac9fd09b949821260b77 (patch) | |
| tree | 84e703d42c69ee1cb49b152a141b179830aade11 /cpp/src/qpid | |
| parent | 1b8de5a72a9bb1faadfd685975f2c99efdb0b0d4 (diff) | |
| download | qpid-python-d4408a59e892bd66cd17ac9fd09b949821260b77.tar.gz | |
handle fail setting last-node-standing with unit test, still needs system test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@799658 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 3c8c237b98..08ee133981 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -677,21 +677,25 @@ void Queue::setLastNodeFailure() { if (persistLastNode){ Mutex::ScopedLock locker(messageLock); - for ( Messages::iterator i = messages.begin(); i != messages.end(); ++i ) { - if (lastValueQueue) checkLvqReplace(*i); - // don't force a message twice to disk. - if(!i->payload->isStoredOnQueue(shared_from_this())) { - i->payload->forcePersistent(); - if (i->payload->isForcedPersistent() ){ - enqueue(0, i->payload); + try { + for ( Messages::iterator i = messages.begin(); i != messages.end(); ++i ) { + if (lastValueQueue) checkLvqReplace(*i); + // don't force a message twice to disk. + if(!i->payload->isStoredOnQueue(shared_from_this())) { + i->payload->forcePersistent(); + if (i->payload->isForcedPersistent() ){ + enqueue(0, i->payload); + } } - } - } + } + } catch (const std::exception& e) { + // Could not go into last node standing (for example journal not large enough) + QPID_LOG(error, "Unable to fail to last node standing for queue: " << name << " : " << e.what()); + } inLastNodeFailure = true; } } - // return true if store exists, bool Queue::enqueue(TransactionContext* ctxt, boost::intrusive_ptr<Message> msg) { |
