Skip to content

Commit a62c724

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

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
@@ -733,6 +733,11 @@ Glossary
733733
need to run :dbcommand:`cleanupOrphaned` to delete orphaned
734734
documents.
735735

736+
orphaned cursor
737+
A cursor that is not properly closed or iterated over
738+
in your application code. Orphaned cursors can cause performance
739+
issues in your MongoDB deployment.
740+
736741
passive member
737742
A member of a :term:`replica set` that cannot become primary
738743
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
@@ -1077,6 +1077,21 @@ General Parameters
10771077
cursor modifier to analyze the average query time and select an appropriate
10781078
timeout period.
10791079

1080+
.. warning::
1081+
1082+
Starting in MongoDB 4.4.8, MongoDB cleans up
1083+
:term:`orphaned cursors <orphaned cursor>` linked to sessions as
1084+
part of session management. This means that orphaned cursors with
1085+
session ids do not use ``cursorTimeoutMillis`` to control the
1086+
timeout.
1087+
1088+
For operations that return a cursor and have an idle period
1089+
longer than :parameter:`localLogicalSessionTimeoutMinutes`,
1090+
use :method:`Mongo.startSession()` to perform the operation
1091+
within an explicit session. To refresh the session, run
1092+
the :dbcommand:`refreshSessions` command. For details, see
1093+
:ref:`<refresh-session-cursor-example>`.
1094+
10801095
.. parameter:: failIndexKeyTooLong
10811096

10821097
*Removed in 4.4*

0 commit comments

Comments
 (0)