lib/mongo/operation/shared/executable.rb in mongo-2.8.0 vs lib/mongo/operation/shared/executable.rb in mongo-2.9.0.rc0
- old
+ new
@@ -43,13 +43,28 @@
end
end
def process_result(result, server)
server.update_cluster_time(result)
+
if result.not_master? || result.node_recovering?
+ if result.node_shutting_down?
+ disconnect_pool = true
+ else
+ # Max wire version needs to be checked prior to marking the
+ # server unknown
+ disconnect_pool = server.description.max_wire_version < 8
+ end
+
server.unknown!
+
+ if disconnect_pool
+ server.pool.disconnect!
+ end
+
server.monitor.scan_semaphore.signal
end
+
session.process(result) if session
result
end
end
end