summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2020-10-08 22:18:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-09 13:44:35 +0000
commita5ab1eda7d43aee1f944bb2f1e3734924aa5566c (patch)
tree28872efb7f1d6e8123d09ed827c9083f1851604d
parentee3c94bb462b757cd12e77c6c23ac3e56b01c194 (diff)
downloadmongo-a5ab1eda7d43aee1f944bb2f1e3734924aa5566c.tar.gz
SERVER-50103 Don't send killCursor request for exhaust cursors in DBClientCursor
-rw-r--r--src/mongo/client/dbclient_cursor.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp
index 259d032da62..32782e4172c 100644
--- a/src/mongo/client/dbclient_cursor.cpp
+++ b/src/mongo/client/dbclient_cursor.cpp
@@ -635,13 +635,11 @@ void DBClientCursor::kill() {
}
};
+ // We only need to kill the cursor if there aren't pending replies. Pending replies
+ // indicates that this is an exhaust cursor, so the connection must be closed and the
+ // cursor will automatically be cleaned up by the upstream server.
if (_client && !_connectionHasPendingReplies) {
killCursor(_client);
- } else {
- // Use a side connection to send the kill cursor request.
- verify(_scopedHost.size() || (_client && _connectionHasPendingReplies));
- DBClientBase::withConnection_do_not_use(
- _client ? _client->getServerAddress() : _scopedHost, killCursor);
}
}
});