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

A closed Topology may be updated by a closed Server Monitor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.6.1
    • Affects Version/s: None
    • Component/s: Internal
    • None

      There's some racy behavior when closing a MongoClient although I'm not sure it causes any problems. A closed monitor thread may update a closed Topology. The situation is:

      1) Topology is closed.
      2) Monitor is closed in the middle of an isMaster check.
      3) Monitor thread finishes isMaster check and calls Topology.on_change.
      4) Topology is updated while closed, possibly creating and opening new Servers.

      A possible fix might be to make Topology.on_change a no-op when closed.

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

              Created:
              Updated:
              Resolved: