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

Rework replica set monitoring

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      ReplicaSetConnection uses a thread (or greenlet in a gevent context) to monitor the health and membership of the replica set. The threaded monitor currently calls refresh() on the ReplicaSetConnection instance. The thread isn't currently a daemon due to serious issues with CPython interpreter teardown and daemon threads. This means applications (and users in the python interactive shell) have to call ReplicaSetConnection.close() to terminate the thread.

      Two possible alternative approaches:
      1. Get rid of the monitor thread. This means every <monitor interval> seconds we would have to interrupt a user operation to refresh our view of the set.
      2. Completely rewrite the monitor so it no longer calls ReplicaSetConnection.refresh(). The design would have to work around the known issues with CPython daemon threads.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: