-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.6.3
-
Component/s: Core
-
Empty show more show less
Cloned cursor operations may occasionally fail with "MongoError: Cannot use a session that has ended". This is caused by reusing ClientSession of the original cursor's operation.
Here is the code to reproduce the bug.
This part of the driver spec seems to be violated
An implicit session MUST be returned to the pool immediately following the completion of an operation. When an implicit session is associated with a cursor for use with getMore operations, the session MUST be returned to the pool immediately following a getMore operation that indicates that the cursor has been exhausted.
In terms of the session not being "returned to the pool immediately", but being used by other operation.