mongodb_proxy.py
3.2 KB
-
Attempt to reconnect for 60 seconds; make it configurable log delay time · b5d23ab8
The MongoDB documentation says it can take up to 60 seconds for a new primary to be elected when replicaset failover occurs (http://docs.mongodb.org/manual/faq/replica-sets/#how-long-does-replica-set-failover-take). Therefore, we need to wait up to 60 seconds for failover, not 16 seconds. Make the wait interval configurable by adding an optional wait_time parameter to the MongoProxy initializer. When logging attempts to auto-reconnect, include the elapsed time in the log message.
Jonathan Kamens committed