summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/async_results_merger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/query/async_results_merger.cpp')
-rw-r--r--src/mongo/s/query/async_results_merger.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/query/async_results_merger.cpp b/src/mongo/s/query/async_results_merger.cpp
index 56f2deff96e..363e151fbfd 100644
--- a/src/mongo/s/query/async_results_merger.cpp
+++ b/src/mongo/s/query/async_results_merger.cpp
@@ -852,6 +852,11 @@ void AsyncResultsMerger::_scheduleKillCursors(WithLock, OperationContext* opCtx)
executor::RemoteCommandRequest request(
remote.getTargetHost(), _params.getNss().db().toString(), cmdObj, opCtx);
+ // The 'RemoteCommandRequest' takes the remaining time from the 'opCtx' parameter. If
+ // the cursor was killed due to a maxTimeMs timeout, the remaining time will be 0, and
+ // the remote request will not be sent. To avoid this, we remove the timeout for the
+ // remote 'killCursor' command.
+ request.timeout = executor::RemoteCommandRequestBase::kNoTimeout;
// Send kill request; discard callback handle, if any, or failure report, if not.
_executor->scheduleRemoteCommand(request, [](auto const&) {}).getStatus().ignore();