diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-05-27 19:36:59 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-06-05 14:21:56 -0400 |
commit | 51c2064d518140fbeae62f9d7ba29f1d69fb530f (patch) | |
tree | b6d97eb91b4ac76279eb983234c6ec63ac44a8c6 /src/mongo/db/index_builder.cpp | |
parent | 1cf11a282870c26ce7d963fb3a6c3329b39d90a2 (diff) | |
download | mongo-51c2064d518140fbeae62f9d7ba29f1d69fb530f.tar.gz |
SERVER-18277 Stronger locking rules for CurOp and OpDebug.
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r-- | src/mongo/db/index_builder.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index 6d205c45da9..e5939343265 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -87,7 +87,10 @@ namespace { AuthorizationSession::get(txn.getClient())->grantInternalAuthorization(); - CurOp::get(txn)->setOp(dbInsert); + { + stdx::lock_guard<Client> lk(*txn.getClient()); + CurOp::get(txn)->setOp_inlock(dbInsert); + } NamespaceString ns(_index["ns"].String()); ScopedTransaction transaction(&txn, MODE_IX); @@ -141,8 +144,11 @@ namespace { } } - // Show which index we're building in the curop display. - CurOp::get(txn)->setQuery(_index); + { + stdx::lock_guard<Client> lk(*txn->getClient()); + // Show which index we're building in the curop display. + CurOp::get(txn)->setQuery_inlock(_index); + } bool haveSetBgIndexStarting = false; while (true) { |