Background task should clean up perished connections even when minPoolSize = 0

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.18.0
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Not Needed
    • None
    • Needed
    • Hide

      For the MongoDB manual connection pool section here: https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/connection-pools/

       

      Add a note for changes to pool behaviour in 6.18.0 in the minPoolSize option section:

      A MongoClient configured with a maxIdleTimeMS and minPoolSize of 0 is advantageous for workloads that have sustained periods of little or no activity because it allows the connection pool to close connections that are unused during these periods of inactivity. However, due to a bug in the connection pool implementation, idle / perished connections were not cleaned up unless minPoolSize was non-zero.

      With the changes in 6.18.0, the connection pool now always cleans up idle connections, regardless of minPoolSize.

      Show
      For the MongoDB manual connection pool section here: https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/connection-pools/   Add a note for changes to pool behaviour in 6.18.0 in the minPoolSize option section: A MongoClient configured with a maxIdleTimeMS and minPoolSize of 0 is advantageous for workloads that have sustained periods of little or no activity because it allows the connection pool to close connections that are unused during these periods of inactivity. However, due to a bug in the connection pool implementation, idle / perished connections were not cleaned up unless minPoolSize was non-zero. With the changes in 6.18.0, the connection pool now always cleans up idle connections, regardless of minPoolSize .
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a... user with an unset minPoolSize and set maxIdleTimeMS
      I want... perished connections to be periodically cleaned up in the background
      So that...  I don't leave unusable resources open while the pool is idle

      User Experience

      Unknowns

      • Should we update the background thread frequency to be configurable?

      Acceptance Criteria

      Implementation Requirements

      Testing Requirements

      • Add a test to make sure that the cleanup happens (make sure it fails before the fix and succeeds after)

      Documentation Requirements

      • Update API docs for maxIdleTimeMS to reflect spec documentation and also clarify the difference between being 'idle' / or unused and being marked as 'idle'

      Follow Up Requirements

      • N/A

            Assignee:
            Bailey Pearson
            Reporter:
            Aditi Khare (Inactive)
            Daria Pardue, Durran Jordan
            Votes:
            4 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: