Author: kpvdr
Date: 2010-08-18 11:40:28 -0400 (Wed, 18 Aug 2010)
New Revision: 4212
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/TxnCtxt.cpp
Log:
BZ 614944 - "qpidd broker crash in mrg::msgstore::TxnCtxt::abort() ->
DbTxn::abort()". Added additional exception handling for store BDB initialization in
TxnCtxt::begin() after QE came across another unhandled case.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-08-17 17:33:36 UTC (rev 4211)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-08-18 15:40:28 UTC (rev 4212)
@@ -365,6 +365,8 @@
QPID_LOG(error, "BDB exception occurred while initializing store: "
<< e.what());
if (bdbRetryCnt >= retryMax)
THROW_STORE_EXCEPTION_2("BDB exception occurred while initializing
store", e);
+ } catch (const StoreException&) {
+ throw;
} catch (const journal::jexception& e) {
QPID_LOG(error, "Journal Exception occurred while initializing store:
" << e);
THROW_STORE_EXCEPTION_2("Journal Exception occurred while initializing
store", e.what());
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-17 17:33:36 UTC (rev 4211)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-18 15:40:28 UTC (rev 4212)
@@ -73,7 +73,7 @@
TxnCtxt::TxnCtxt(std::string _tid, IdSequence* _loggedtx) : loggedtx(_loggedtx),
dtokp(new DataTokenImpl), preparedXidStorePtr(0), tid(_tid), txn(0) {}
-TxnCtxt::~TxnCtxt() { if(txn) abort(); }
+TxnCtxt::~TxnCtxt() { abort(); }
void TxnCtxt::sync() {
if (loggedtx) {
@@ -107,7 +107,14 @@
}
void TxnCtxt::begin(DbEnv* env, bool sync) {
- env->txn_begin(0, &txn, 0);
+ int err;
+ try { err = env->txn_begin(0, &txn, 0); }
+ catch (const DbException&) { txn = 0; throw; }
+ if (err != 0) {
+ std::ostringstream oss;
+ oss << "Error: Env::txn_begin() returned error code: " <<
err;
+ THROW_STORE_EXCEPTION(oss.str());
+ }
if (sync)
globalHolder = AutoScopedLock(new
qpid::sys::Mutex::ScopedLock(globalSerialiser));
}
Show replies by date