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

Reset the monitor's pool after _check_once failed in the _check_with_retry function

      In the function named Monitor._check_with_retry, if _check_once failed, the monitor will call self._topology.reset_pool(address) to reset the server's pool. But, it doesn't reset the monitor's pool. I think the monitor need reset both its own pool and server's pool.

      I have a circumstance. Our System Administrator provide a host for us to get multiple mongos IP address, our application need to choose one mongos to connect. In order to auto reconnect to another mongos after a mongos goes down. I need to write a new Pool class, the Pool class need to choose a new mongos in the _init_ function and reset_pool function. But, after I finished the Pool class. I found that when a mongos goes down , the monitor reset the server's pool every time the monitor call self._check_with_retry. Because the monitor didn't reset its own pool.

      I write a new Monitor class to reset its own pool, but the _check_with_retry function is not a public function. So, it's not guaranted that the function will not be removed or changed.

      So, I think the code that reset the monitor's pool need add into the Monitor class.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            dennisxie Dennis Xie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: