diff options
author | Geert Bosch <geert@mongodb.com> | 2017-02-06 09:52:30 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-02-06 14:50:12 -0500 |
commit | ddc34321a7b0019612ee2c093e84cb01b489dd79 (patch) | |
tree | 3a630682ba137081da8cde9796306adf70de2c9d | |
parent | f73b0f30be37d0093131f828aa049cf933bb4873 (diff) | |
download | mongo-ddc34321a7b0019612ee2c093e84cb01b489dd79.tar.gz |
SERVER-27920 Fix incorrect locking of Client context
-rw-r--r-- | src/mongo/db/assemble_response.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/distinct.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/find_and_modify.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/geo_near_cmd.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/getmore_cmd.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/group_cmd.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/killcursors_cmd.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/mr.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/query/find.cpp | 2 |
12 files changed, 19 insertions, 19 deletions
diff --git a/src/mongo/db/assemble_response.cpp b/src/mongo/db/assemble_response.cpp index 6e14055aeed..4c6121dfb2b 100644 --- a/src/mongo/db/assemble_response.cpp +++ b/src/mongo/db/assemble_response.cpp @@ -411,7 +411,7 @@ bool receivedGetMore(OperationContext* txn, DbResponse& dbresponse, Message& m, curop.debug().cursorid = cursorid; { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setNS_inlock(ns); } diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index ed2c03d6dad..0f619356f96 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -218,7 +218,7 @@ public: } { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock( Explain::getPlanSummary(executor.getValue().get())); } diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index fed55c1c10b..79ee34203ce 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -427,7 +427,7 @@ public: std::move(statusWithPlanExecutor.getValue()); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } @@ -533,7 +533,7 @@ public: std::move(statusWithPlanExecutor.getValue()); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index bdb0ea33fd6..d2b5075e283 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -329,7 +329,7 @@ public: std::unique_ptr<PlanExecutor> exec = std::move(statusWithPlanExecutor.getValue()); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index eae4d16be7e..159feb2e74f 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -247,7 +247,7 @@ public: auto curOp = CurOp::get(txn); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 6c956180070..0381d462f56 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -224,7 +224,7 @@ public: { // Set the namespace of the curop back to the view namespace so ctx records // stats on this view namespace on destruction. - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setNS_inlock(origNss.ns()); } return retVal; @@ -330,7 +330,7 @@ public: auto planSummary = Explain::getPlanSummary(exec); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setPlanSummary_inlock(planSummary); // Ensure that the original query or command object is available in the slow query log, diff --git a/src/mongo/db/commands/group_cmd.cpp b/src/mongo/db/commands/group_cmd.cpp index 71f9bdbd408..8d91be1f920 100644 --- a/src/mongo/db/commands/group_cmd.cpp +++ b/src/mongo/db/commands/group_cmd.cpp @@ -179,7 +179,7 @@ private: auto curOp = CurOp::get(txn); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setPlanSummary_inlock(Explain::getPlanSummary(planExecutor.get())); } diff --git a/src/mongo/db/commands/killcursors_cmd.cpp b/src/mongo/db/commands/killcursors_cmd.cpp index 4c85e5f8f99..5831d3b2cc0 100644 --- a/src/mongo/db/commands/killcursors_cmd.cpp +++ b/src/mongo/db/commands/killcursors_cmd.cpp @@ -69,7 +69,7 @@ private: { // Set the namespace of the curop back to the view namespace so ctx records // stats on this view namespace on destruction. - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setNS_inlock(nss.ns()); } return status; diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index c3f0a27dc07..194684bdc2b 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1521,7 +1521,7 @@ public: } { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index c34ee28a72c..0f07e38c830 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -429,7 +429,7 @@ public: { // Set the namespace of the curop back to the view namespace so ctx records // stats on this view namespace on destruction. - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setNS_inlock(nss.ns()); } return status; @@ -500,7 +500,7 @@ public: { auto planSummary = Explain::getPlanSummary(exec.get()); - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp->setPlanSummary_inlock(std::move(planSummary)); } diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index c3e36232801..a2a7e74167b 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -419,7 +419,7 @@ WriteResult performInserts(OperationContext* txn, const InsertOp& wholeOp) { }); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp.setNS_inlock(wholeOp.ns.ns()); curOp.setLogicalOp_inlock(LogicalOp::opInsert); curOp.ensureStarted(); @@ -534,7 +534,7 @@ static WriteResult::SingleResult performSingleUpdateOp(OperationContext* txn, getExecutorUpdate(txn, &curOp.debug(), collection->getCollection(), &parsedUpdate)); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } @@ -580,7 +580,7 @@ WriteResult performUpdates(OperationContext* txn, const UpdateOp& wholeOp) { Command* cmd = parentCurOp.getCommand(); CurOp curOp(txn); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp.setCommand_inlock(cmd); } ON_BLOCK_EXIT([&] { finishCurOp(txn, &curOp); }); @@ -645,7 +645,7 @@ static WriteResult::SingleResult performSingleDeleteOp(OperationContext* txn, getExecutorDelete(txn, &curOp.debug(), collection.getCollection(), &parsedDelete)); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); CurOp::get(txn)->setPlanSummary_inlock(Explain::getPlanSummary(exec.get())); } @@ -687,7 +687,7 @@ WriteResult performDeletes(OperationContext* txn, const DeleteOp& wholeOp) { Command* cmd = parentCurOp.getCommand(); CurOp curOp(txn); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp.setCommand_inlock(cmd); } ON_BLOCK_EXIT([&] { finishCurOp(txn, &curOp); }); diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 6b940ee1750..d3f7e80e2e7 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -376,7 +376,7 @@ Message getMore(OperationContext* txn, auto planSummary = Explain::getPlanSummary(exec); { - stdx::lock_guard<Client>(*txn->getClient()); + stdx::lock_guard<Client> lk(*txn->getClient()); curOp.setPlanSummary_inlock(planSummary); // Ensure that the original query or command object is available in the slow query log, |