diff options
author | James Wahlin <james@mongodb.com> | 2018-07-20 09:05:04 -0400 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2018-07-27 14:14:20 -0400 |
commit | 54f1582fc6eb01de4d4c42f26fc133e623f065fb (patch) | |
tree | 5267a15f4d28a68d9ecf0dc0622c26fa52832a1d /src/mongo/db/commands/getmore_cmd.cpp | |
parent | 9d5a4298d2dd876d0762b27221332f0d9cc1871e (diff) | |
download | mongo-r4.0.1.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/commands/getmore_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/getmore_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 71b7f548baf..7859c7b81fe 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -368,7 +368,8 @@ public: opCtx->getServiceContext()->getPreciseClockSource()->now() + request.awaitDataTimeout.value_or(Seconds{1}); } else if (cursor->getLeftoverMaxTimeMicros() < Microseconds::max()) { - opCtx->setDeadlineAfterNowBy(cursor->getLeftoverMaxTimeMicros()); + opCtx->setDeadlineAfterNowBy(cursor->getLeftoverMaxTimeMicros(), + ErrorCodes::MaxTimeMSExpired); } } if (!cursor->isAwaitData()) { |