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

mongoc_cursor_destroy need not send killCursors after a CursorNotFound error

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • libmongoc
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: