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

Delay starting pymongo_kill_cursors_thread when connect=False

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

      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.

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

              Created:
              Updated:
              Resolved: