summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/find.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2018-07-20 09:05:04 -0400
committerJames Wahlin <james@mongodb.com>2018-07-27 14:14:20 -0400
commit54f1582fc6eb01de4d4c42f26fc133e623f065fb (patch)
tree5267a15f4d28a68d9ecf0dc0622c26fa52832a1d /src/mongo/db/query/find.cpp
parent9d5a4298d2dd876d0762b27221332f0d9cc1871e (diff)
downloadmongo-r4.0.1-rc1.tar.gz
SERVER-35031 Return MaxTimeMSExpired for maxTimeMS timeoutr4.0.1-rc1r4.0.1
Adds a new 'MaxTimeMSExpired' error code, returned when a timeout occurs due to exceeding of maxTimeMS. Timeouts unrelated to maxTimeMS will continue to return 'ExceededTimeLimit'. (cherry picked from commit 35528523c00b72a210dc5b78a427d90ed1c14331)
Diffstat (limited to 'src/mongo/db/query/find.cpp')
-rw-r--r--src/mongo/db/query/find.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 249a61349fb..3d17df3f4e7 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -368,7 +368,8 @@ Message getMore(OperationContext* opCtx,
uassert(40136,
"Illegal attempt to set operation deadline within DBDirectClient",
!opCtx->getClient()->isInDirectClient());
- opCtx->setDeadlineAfterNowBy(cc->getLeftoverMaxTimeMicros());
+ opCtx->setDeadlineAfterNowBy(cc->getLeftoverMaxTimeMicros(),
+ ErrorCodes::MaxTimeMSExpired);
}
opCtx->checkForInterrupt(); // May trigger maxTimeAlwaysTimeOut fail point.
@@ -589,7 +590,7 @@ std::string runQuery(OperationContext* opCtx,
uassert(40116,
"Illegal attempt to set operation deadline within DBDirectClient",
!opCtx->getClient()->isInDirectClient());
- opCtx->setDeadlineAfterNowBy(Milliseconds{qr.getMaxTimeMS()});
+ opCtx->setDeadlineAfterNowBy(Milliseconds{qr.getMaxTimeMS()}, ErrorCodes::MaxTimeMSExpired);
}
opCtx->checkForInterrupt(); // May trigger maxTimeAlwaysTimeOut fail point.