-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.0
-
Component/s: None
-
None
If a standalone server goes down, it is removed from the cluster servers list, so it is not monitored/checked ever again. After it is back up and running, it is not added back.
One possible solution is to not subscribe it to events as follows.
module Mongo class Cluster def initialize(client, addresses, options = {}) @client = client @addresses = addresses @options = options.freeze @mode = Mode.get(options) @servers = addresses.map do |address| Server.new(address, options).tap do |server| unless @mode == Mongo::Cluster::Mode::Standalone subscribe_to(server, Event::SERVER_ADDED, Event::ServerAdded.new(self)) subscribe_to(server, Event::SERVER_REMOVED, Event::ServerRemoved.new(self)) end end end end end