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

Delay starting pymongo_kill_cursors_thread when connect=False

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When creating a MongoClient with the connect=False option we should delay starting the pymongo_kill_cursors_thread. This is a minor improvement that reduces the number of threads for unused (connect=False) clients.

      At first glance it might also seem like a good idea to always delay starting the pymongo_kill_cursors_thread until the first operation (first call to _get_topology()) however we should not go that far. This thread is responsible for more than just killing cursors, it also ensures that there are minPoolSize connections. Opening minPoolSize connections in the background is a good thing since it can reduce the latency of the first operation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              shane.harvey Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: