diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-04-23 17:50:55 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-04-23 18:02:53 -0400 |
commit | ab8295bf7cc572a391e8c364b5291f1d9b3b0720 (patch) | |
tree | 440f00fab6ef56747c46bdc995fc41a07aa45845 /src/mongo/db/instance.cpp | |
parent | 1f24d43e419b674bfe866bdebf8224d44fa163b0 (diff) | |
download | mongo-ab8295bf7cc572a391e8c364b5291f1d9b3b0720.tar.gz |
Revert "SERVER-18131 Clean up LastError."
This reverts commit 54c25da33ec7270295c8948f6a51376ec4fd278c and
commit c952a9396a1843aa45d6afa3c6785dec607de112.
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r-- | src/mongo/db/instance.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index 099492d607a..80bf95116ce 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -389,7 +389,6 @@ namespace { Client& c = *txn->getClient(); if (!c.isInDirectClient()) { - LastError::get(c).startRequest(); AuthorizationSession::get(c)->startRequest(txn); // We should not be holding any locks at this point @@ -557,14 +556,14 @@ namespace { } } catch (const UserException& ue) { - LastError::get(c).setLastError(ue.getCode(), ue.getInfo().msg); + setLastError(ue.getCode(), ue.getInfo().msg.c_str()); MONGO_LOG_COMPONENT(3, responseComponent) << " Caught Assertion in " << opToString(op) << ", continuing " << ue.toString() << endl; debug.exceptionInfo = ue.getInfo(); } catch (const AssertionException& e) { - LastError::get(c).setLastError(e.getCode(), e.getInfo().msg); + setLastError(e.getCode(), e.getInfo().msg.c_str()); MONGO_LOG_COMPONENT(3, responseComponent) << " Caught Assertion in " << opToString(op) << ", continuing " << e.toString() << endl; @@ -605,7 +604,6 @@ namespace { } void receivedKillCursors(OperationContext* txn, Message& m) { - LastError::get(txn->getClient()).disable(); DbMessage dbmessage(m); int n = dbmessage.pullInt(); @@ -702,8 +700,7 @@ namespace { UpdateResult res = UpdateStage::makeUpdateResult(exec.get(), &op.debug()); // for getlasterror - LastError::get(txn->getClient()).recordUpdate( - res.existing, res.numMatched, res.upserted); + lastError.getSafe()->recordUpdate( res.existing , res.numMatched , res.upserted ); return; } break; @@ -756,8 +753,7 @@ namespace { uassertStatusOK(exec->executePlan()); UpdateResult res = UpdateStage::makeUpdateResult(exec.get(), &op.debug()); - LastError::get(txn->getClient()).recordUpdate( - res.existing, res.numMatched, res.upserted); + lastError.getSafe()->recordUpdate( res.existing , res.numMatched , res.upserted ); } MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "update", nsString.ns()); } @@ -815,7 +811,7 @@ namespace { // Run the plan and get the number of docs deleted. uassertStatusOK(exec->executePlan()); long long n = DeleteStage::getNumDeleted(exec.get()); - LastError::get(txn->getClient()).recordDelete(n); + lastError.getSafe()->recordDelete(n); op.debug().ndeleted = n; break; @@ -1005,7 +1001,7 @@ namespace { globalOpCounters.incInsertInWriteLock(i); throw; } - LastError::get(txn->getClient()).setLastError(ex.getCode(), ex.getInfo().msg); + setLastError(ex.getCode(), ex.getInfo().msg.c_str()); // otherwise ignore and keep going } } @@ -1059,7 +1055,7 @@ namespace { convertSystemIndexInsertsToCommands(d, &allCmdsBuilder); } catch (const DBException& ex) { - LastError::get(txn->getClient()).setLastError(ex.getCode(), ex.getInfo().msg); + setLastError(ex.getCode(), ex.getInfo().msg.c_str()); curOp.debug().exceptionInfo = ex.getInfo(); return; } @@ -1081,7 +1077,7 @@ namespace { uassertStatusOK(Command::getStatusFromCommandResult(resultBuilder.done())); } catch (const DBException& ex) { - LastError::get(txn->getClient()).setLastError(ex.getCode(), ex.getInfo().msg); + setLastError(ex.getCode(), ex.getInfo().msg.c_str()); curOp.debug().exceptionInfo = ex.getInfo(); if (!keepGoing) { return; |