Skip to content

Commit 5d8e82e

Browse files
ajhuh-mdbjeff-allen-mongo
authored andcommitted
DOCS-13976 update cursor timeout conditions to reflect behavior when belonging to a server session
1 parent dbc366d commit 5d8e82e

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

source/reference/glossary.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,11 @@ Glossary
208208

209209
cursor
210210
A pointer to the result set of a :term:`query`. Clients can
211-
iterate through a cursor to retrieve results. By default, cursors
212-
timeout after 10 minutes of inactivity. See
213-
:ref:`read-operations-cursors`.
211+
iterate through a cursor to retrieve results. By default, cursors
212+
not opened within a session automatically timeout after 10
213+
minutes of inactivity. Cursors opened under a session close with
214+
the end or timeout of the session.
215+
See :ref:`read-operations-cursors`.
214216

215217
daemon
216218
The conventional name for a background, non-interactive

source/release-notes/5.0.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,16 @@ collections is lower than 0.5 GB. When the cumulative size of the
789789
The estimated size in bytes of a ``plan cache`` entry is available in
790790
the output of :pipeline:`$planCacheStats`.
791791

792+
Closure of Inactive Cursors Opened Within a Session
793+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
794+
795+
Starting in MongoDB 5.0 (and 4.4.8), cursors created within a
796+
:doc:`client session </core/read-isolation-consistency-recency>` close
797+
when the corresponding :doc:`server session </reference/server-sessions>`
798+
ends with the :dbcommand:`killSessions` command, if the session times
799+
out, or if the client has exhausted the cursor.
800+
See :ref:`read-operations-cursors`.
801+
792802
.. _5.0-rel-notes-platforms:
793803

794804
Platform Support

source/tutorial/iterate-a-cursor.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,26 @@ The ``myCursor[1]`` is equivalent to the following example:
118118
Cursor Behaviors
119119
----------------
120120

121-
Closure of Inactive Cursors
122-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
121+
Cursors Opened Within a Session
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123123

124-
By default, the server will automatically close the cursor after 10
125-
minutes of inactivity, or if client has exhausted the cursor. To
126-
override this behavior in :binary:`~bin.mongosh`, you can use
127-
the :method:`cursor.noCursorTimeout()` method:
124+
Starting in MongoDB 5.0 (and 4.4.8), cursors created within a
125+
:doc:`client session </core/read-isolation-consistency-recency>` close
126+
when the corresponding :doc:`server session </reference/server-sessions>`
127+
ends with the :dbcommand:`killSessions` command, if the session times
128+
out, or if the client has exhausted the cursor.
129+
130+
By default, server sessions have an expiration timeout of 30 minutes. To
131+
change the value, set the :parameter:`localLogicalSessionTimeoutMinutes`
132+
parameter when starting up :binary:`~bin.mongod`.
133+
134+
Cursors Opened Outside of a Session
135+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136+
137+
Cursors that aren't opened under a session automatically close after 10
138+
minutes of inactivity, or if client has exhausted the cursor. To
139+
override this behavior in :binary:`~bin.mongosh`, you can use the
140+
:method:`cursor.noCursorTimeout()` method:
128141

129142
.. code-block:: javascript
130143

@@ -135,6 +148,7 @@ manually with :method:`cursor.close()` or by exhausting the cursor's results.
135148

136149
See your :driver:`driver </>` documentation for
137150
information on setting the ``noCursorTimeout`` option.
151+
138152

139153
.. _cursor-isolation:
140154

0 commit comments

Comments
 (0)