summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/getmore_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/getmore_cmd.cpp')
-rw-r--r--src/mongo/db/commands/getmore_cmd.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp
index 709b6b9c76a..9c327ec57af 100644
--- a/src/mongo/db/commands/getmore_cmd.cpp
+++ b/src/mongo/db/commands/getmore_cmd.cpp
@@ -301,20 +301,16 @@ public:
const bool hasOwnMaxTime = txn->hasDeadline();
- if (!hasOwnMaxTime) {
+ // We assume that cursors created through a DBDirectClient are always used from their
+ // original OperationContext, so we do not need to move time to and from the cursor.
+ if (!hasOwnMaxTime && !txn->getClient()->isInDirectClient()) {
// There is no time limit set directly on this getMore command. If the cursor is
// awaitData, then we supply a default time of one second. Otherwise we roll over
// any leftover time from the maxTimeMS of the operation that spawned this cursor,
// applying it to this getMore.
if (isCursorAwaitData(cursor)) {
- uassert(40117,
- "Illegal attempt to set operation deadline within DBDirectClient",
- !txn->getClient()->isInDirectClient());
txn->setDeadlineAfterNowBy(Seconds{1});
} else if (cursor->getLeftoverMaxTimeMicros() < Microseconds::max()) {
- uassert(40118,
- "Illegal attempt to set operation deadline within DBDirectClient",
- !txn->getClient()->isInDirectClient());
txn->setDeadlineAfterNowBy(cursor->getLeftoverMaxTimeMicros());
}
}