Skip to content

Commit b3172e5

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

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
@@ -771,6 +771,11 @@ Glossary
771771
need to run :dbcommand:`cleanupOrphaned` to delete orphaned
772772
documents.
773773

774+
orphaned cursor
775+
A cursor that is not properly closed or iterated over
776+
in your application code. Orphaned cursors can cause performance
777+
issues in your MongoDB deployment.
778+
774779
passive member
775780
A member of a :term:`replica set` that cannot become primary
776781
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
@@ -2,7 +2,11 @@
22
cursor.noCursorTimeout()
33
========================
44

5-
.. default-domain:: mongodb
5+
.. contents:: On this page
6+
:local:
7+
:backlinks: none
8+
:depth: 1
9+
:class: singlecol
610

711
Definition
812
----------
@@ -43,6 +47,11 @@ cursor being configured with :method:`~cursor.noCursorTimeout`. When the
4347
application requests the next batch of documents, the server returns an
4448
error.
4549

50+
.. _refresh-session-cursor-example:
51+
52+
Refresh a Cursor with ``refreshSessions``
53+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54+
4655
For operations that return a cursor, if the cursor may be idle for
4756
longer than 30 minutes, issue the operation within an explicit session
4857
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
@@ -1207,6 +1207,21 @@ General Parameters
12071207
cursor modifier to analyze the average query time and select an appropriate
12081208
timeout period.
12091209

1210+
.. warning::
1211+
1212+
Starting in MongoDB 4.4.8, MongoDB cleans up
1213+
:term:`orphaned cursors <orphaned cursor>` linked to sessions as
1214+
part of session management. This means that orphaned cursors with
1215+
session ids do not use ``cursorTimeoutMillis`` to control the
1216+
timeout.
1217+
1218+
For operations that return a cursor and have an idle period
1219+
longer than :parameter:`localLogicalSessionTimeoutMinutes`,
1220+
use :method:`Mongo.startSession()` to perform the operation
1221+
within an explicit session. To refresh the session, run
1222+
the :dbcommand:`refreshSessions` command. For details, see
1223+
:ref:`<refresh-session-cursor-example>`.
1224+
12101225
.. parameter:: failIndexKeyTooLong
12111226

12121227
*Removed in 4.4*

0 commit comments

Comments
 (0)