summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/current_op.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-06-01 17:32:33 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-06-02 12:05:59 -0400
commit754f482c204160bf0c74373b64ba3406604f0731 (patch)
tree479fe9e9afd65bf78ae30b73d00649d41d67389b /src/mongo/db/commands/current_op.cpp
parent908d0cedf82b50c93932916685c4f8fa4748cc6f (diff)
downloadmongo-754f482c204160bf0c74373b64ba3406604f0731.tar.gz
SERVER-14995 Move _killPending from CurOp to OperationContext.
Also, limit the lifetime of OperationContext in MongoD so that it goes out of scope before sending a reply to the client. This is necessary so that operations do not appear in the currentOp command result after the server sends a response to the client.
Diffstat (limited to 'src/mongo/db/commands/current_op.cpp')
-rw-r--r--src/mongo/db/commands/current_op.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp
index b26c811d2d8..d28cb91874e 100644
--- a/src/mongo/db/commands/current_op.cpp
+++ b/src/mongo/db/commands/current_op.cpp
@@ -124,11 +124,12 @@ namespace mongo {
infoBuilder.appendBool("active", static_cast<bool>(opCtx));
if (opCtx) {
infoBuilder.append("opid", opCtx->getOpID());
- // CurOp
- if (CurOp::get(opCtx)) {
- CurOp::get(opCtx)->reportState(&infoBuilder);
+ if (opCtx->isKillPending()) {
+ infoBuilder.append("killPending", true);
}
+ CurOp::get(opCtx)->reportState(&infoBuilder);
+
// LockState
Locker::LockerInfo lockerInfo;
opCtx->lockState()->getLockerInfo(&lockerInfo);