diff options
| author | Shaileja Jain <shaileja.jain@gmail.com> | 2019-07-29 17:18:05 -0400 |
|---|---|---|
| committer | Shaileja Jain <shaileja.jain@gmail.com> | 2019-08-01 11:52:56 -0400 |
| commit | c6c9416779f3786b071bfbaff9a2baa13aad4d0e (patch) | |
| tree | d70f5a626a7ba1cdb397aad234010675c33b348b /src/mongo/executor/remote_command_request.cpp | |
| parent | 5cbe01663884b321c45145c29bb9d9668125392e (diff) | |
| download | mongo-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.cpp | 10 |
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)) {} |
