Skip to content

Commit 0ed05f0

Browse files
DOCSP-32192 Add cursorTimeoutMillis Warning (#4355)
* DOCSP-32192 Add cursorTimeoutMillis Warning * * * * * * * * * IR * * * * * * * * * * * * * IR feedback * * * * * * * XR1 * * * * * * * * * * * * * Apply suggestions from code review Co-authored-by: Jeff Allen <[email protected]> * * * * * * --------- Co-authored-by: Jeff Allen <[email protected]>
1 parent 8ff3dca commit 0ed05f0

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

source/reference/glossary.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,11 @@ Glossary
806806
need to run :dbcommand:`cleanupOrphaned` to delete orphaned
807807
documents.
808808

809+
orphaned cursor
810+
A cursor that is not properly closed or iterated over
811+
in your application code. Orphaned cursors can cause performance
812+
issues in your MongoDB deployment.
813+
809814
passive member
810815
A member of a :term:`replica set` that cannot become primary
811816
because its :rsconf:`members[n].priority` is

source/reference/method/cursor.noCursorTimeout.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
cursor.noCursorTimeout()
55
========================
66

7-
.. default-domain:: mongodb
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
812

913
Definition
1014
----------
@@ -45,6 +49,11 @@ cursor being configured with :method:`~cursor.noCursorTimeout`. When the
4549
application requests the next batch of documents, the server returns an
4650
error.
4751

52+
.. _refresh-session-cursor-example:
53+
54+
Refresh a Cursor with ``refreshSessions``
55+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56+
4857
For operations that return a cursor, if the cursor may be idle for
4958
longer than 30 minutes, issue the operation within an explicit session
5059
using :method:`Mongo.startSession()` and periodically refresh the

source/reference/parameters.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,21 @@ General Parameters
13221322
cursor modifier to analyze the average query time and select an appropriate
13231323
timeout period.
13241324

1325+
.. warning::
1326+
1327+
Starting in MongoDB 4.4.8, MongoDB cleans up
1328+
:term:`orphaned cursors <orphaned cursor>` linked to sessions as
1329+
part of session management. This means that orphaned cursors with
1330+
session ids do not use ``cursorTimeoutMillis`` to control the
1331+
timeout.
1332+
1333+
For operations that return a cursor and have an idle period
1334+
longer than :parameter:`localLogicalSessionTimeoutMinutes`,
1335+
use :method:`Mongo.startSession()` to perform the operation
1336+
within an explicit session. To refresh the session, run
1337+
the :dbcommand:`refreshSessions` command. For details, see
1338+
:ref:`<refresh-session-cursor-example>`.
1339+
13251340
.. parameter:: failIndexKeyTooLong
13261341

13271342
*Removed in 4.4*

0 commit comments

Comments
 (0)