summaryrefslogtreecommitdiff
path: root/src/mongo/executor/remote_command_request.cpp
diff options
context:
space:
mode:
authorShaileja Jain <shaileja.jain@gmail.com>2019-07-29 17:18:05 -0400
committerShaileja Jain <shaileja.jain@gmail.com>2019-08-01 11:52:56 -0400
commitc6c9416779f3786b071bfbaff9a2baa13aad4d0e (patch)
treed70f5a626a7ba1cdb397aad234010675c33b348b /src/mongo/executor/remote_command_request.cpp
parent5cbe01663884b321c45145c29bb9d9668125392e (diff)
downloadmongo-c6c9416779f3786b071bfbaff9a2baa13aad4d0e.tar.gz
SERVER-41493 Set request deadline based on maxtime ms in network interface
Diffstat (limited to 'src/mongo/executor/remote_command_request.cpp')
-rw-r--r--src/mongo/executor/remote_command_request.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp
index be7ce253dd9..38b745bebee 100644
--- a/src/mongo/executor/remote_command_request.cpp
+++ b/src/mongo/executor/remote_command_request.cpp
@@ -59,12 +59,10 @@ RemoteCommandRequestBase::RemoteCommandRequestBase(RequestId requestId,
const BSONObj& metadataObj,
OperationContext* opCtx,
Milliseconds timeoutMillis)
- : id(requestId),
- dbname(theDbName),
- metadata(metadataObj),
- cmdObj(theCmdObj),
- opCtx(opCtx),
- timeout(timeoutMillis) {}
+ : id(requestId), dbname(theDbName), metadata(metadataObj), cmdObj(theCmdObj), opCtx(opCtx) {
+ timeout = opCtx ? std::min<Milliseconds>(opCtx->getRemainingMaxTimeMillis(), timeoutMillis)
+ : timeoutMillis;
+}
RemoteCommandRequestBase::RemoteCommandRequestBase() : id(requestIdCounter.addAndFetch(1)) {}