Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1281

Improve stale socket calculation by recording when it's checked into a pool

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.5
    • Affects Version/s: None
    • Component/s: None
    • None

      I see that the last_checkout attribute of a socket is set when it’s checked out from the pool and is later used to calculate its age. This seems like a misleading name for this option then, as the socket is only idle when it is done being used.
      The last_checkout value is set before it’s used so the “idle time” includes its “in use time”. https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/pool.py#L844

      It seems that the idle time should be calculated using the time at which the socket is returned to the pool.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            emily.stolfo Emily Stolfo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: