summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Saltz <matthew.saltz@mongodb.com>2021-01-19 19:05:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-19 23:24:02 +0000
commitf75145df24d968c4c8b659f6528f7e86da02aa46 (patch)
tree551e4e24b1ecaee6a914dff5df604bc4177f1615
parent2c268821e6c78d8f739f3cfed33793f2af004855 (diff)
downloadmongo-f75145df24d968c4c8b659f6528f7e86da02aa46.tar.gz
SERVER-53512 Make failCommand failpoint support blockConnection with closeConnection:true
-rw-r--r--src/mongo/db/commands.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index 6b279d1ebfe..3db4f644b2b 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -670,15 +670,6 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx,
data.getObjectField(kErrorLabelsFieldName).getOwned());
}
- if (closeConnection) {
- opCtx->getClient()->session()->end();
- LOGV2(20431,
- "Failing {command} via 'failCommand' failpoint: closing connection",
- "Failing command via 'failCommand' failpoint: closing connection",
- "command"_attr = cmd->getName());
- uasserted(50985, "Failing command due to 'failCommand' failpoint");
- }
-
if (blockConnection) {
long long blockTimeMS = 0;
uassert(ErrorCodes::InvalidOptions,
@@ -701,6 +692,15 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx,
"command"_attr = cmd->getName());
}
+ if (closeConnection) {
+ opCtx->getClient()->session()->end();
+ LOGV2(20431,
+ "Failing {command} via 'failCommand' failpoint: closing connection",
+ "Failing command via 'failCommand' failpoint: closing connection",
+ "command"_attr = cmd->getName());
+ uasserted(50985, "Failing command due to 'failCommand' failpoint");
+ }
+
if (hasExtraInfo) {
LOGV2(20434,
"Failing {command} via 'failCommand' failpoint: returning {errorCode} and "