Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3008

Cursor clone reuses other operation's session

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0, 3.6.4
    • Affects Version/s: 3.6.3
    • Component/s: Core

      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.

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            konanmentor@gmail.com Aliaksei Tuzik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: