diff options
author | Matthew Saltz <matthew.saltz@mongodb.com> | 2021-01-19 19:05:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-19 23:24:02 +0000 |
commit | f75145df24d968c4c8b659f6528f7e86da02aa46 (patch) | |
tree | 551e4e24b1ecaee6a914dff5df604bc4177f1615 /src/mongo/db/commands.cpp | |
parent | 2c268821e6c78d8f739f3cfed33793f2af004855 (diff) | |
download | mongo-f75145df24d968c4c8b659f6528f7e86da02aa46.tar.gz |
SERVER-53512 Make failCommand failpoint support blockConnection with closeConnection:true
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r-- | src/mongo/db/commands.cpp | 18 |
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 " |