Starting in MongoDB 3.6, all operations are associated with a ClientSession and cursor's lifetime is tied to the lifetime of the session. Sessions are always discarded after 30 minutes of inactivity (see
https://docs.mongodb.com/manual/reference/parameters/#param.localLogicalSessionTimeoutMinutes). This change means that a cursor will timeout after 30 minutes of inactivity even one created with "no_cursor_timeout=True".
We are working on documenting this limitation:
DOCS-11255In the meantime, to workaround this change in behavior the application can:
- ensure that a cursor will issue a getMore command at least once every <30 minutes, or
- create the cursor with an explicit ClientSession and call refreshSessions at least once every <30 minutes as described in
DOCS-11255.