Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3474

mongoc_cursor_destroy need not send killCursors after a CursorNotFound error

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: libmongoc
    • Labels:
      None

      If the cursor iteration previously failed with a CursorNotFound(43) error, there should be no need to issue a killCursors command when destroying the mongoc_cursor_t. In fact, doing so could inadvertently kill a different cursor if the ID were to be reused between the application encountering a CursorNotFound error during iteration and ultimately calling mongoc_cursor_destroy.

      This is something I noticed while implementing some contrived tests for PHPC-1274, which involved creating a cursor in a parent process, iterating it to completion in a forked child process, and then allowing the parent to destroy its cursor after waiting on the child to terminate.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: