Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-517

Return Connection to pool as soon as MongoCursor is exhausted

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2.0
    • Component/s: None
    • Labels:

      Description

      Currently, if a MongoCursor uses its own Connection (i.e. not one from a ClientSession) the MongoCursor will return the Connection to the pool in deinit.

      However, this could lead to situations where a user has a number of exhausted cursors lying around and exhausts the connection pool.

      One change that will be needed to support this is storing the result of mongoc_cursor_error_document. Otherwise a user will not be able to check for an error after the cursor is exhausted (which they are supposed to do once next() returns nil, as next() can't throw.)

        Attachments

          Activity

            People

            Assignee:
            kaitlin.mahar Kaitlin Mahar
            Reporter:
            kaitlin.mahar Kaitlin Mahar
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: