summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2020-02-21 19:55:52 +0000
committerevergreen <evergreen@mongodb.com>2020-02-21 19:55:52 +0000
commit3463ea25afcbf2c07b96f043904961b5c0f04474 (patch)
tree2f42c1551d692f1b0280998924e0559f4d5980b0 /src/mongo
parent9791eb19d2945a7b60ca0099dc1330c260be78c3 (diff)
downloadmongo-3463ea25afcbf2c07b96f043904961b5c0f04474.tar.gz
SERVER-46258 Fix possible race in failWithErrorCodeInRuncommand failpoint
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/service_entry_point_common.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index 91877503807..7e1209c64de 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -753,8 +753,8 @@ bool runCommandImpl(OperationContext* opCtx,
};
try {
- if (MONGO_unlikely(failWithErrorCodeInRunCommand.shouldFail())) {
- auto scoped = failWithErrorCodeInRunCommand.scoped();
+ if (auto scoped = failWithErrorCodeInRunCommand.scoped();
+ MONGO_unlikely(scoped.isActive())) {
const auto errorCode = scoped.getData()["errorCode"].numberInt();
LOGV2(21960,
"failWithErrorCodeInRunCommand enabled - failing command with error "