def set_config
@node_mutex.synchronize do
begin
if @config
@last_state = @config['ismaster'] ? :primary : :other
end
@config = @client['admin'].command({:ismaster => 1}, :socket => @socket)
if @config['msg']
@client.log(:warn, "#{config['msg']}")
end
unless @client.mongos?
check_set_membership(@config)
check_set_name(@config)
end
rescue ConnectionFailure, OperationFailure, OperationTimeout, SocketError, SystemCallError, IOError => ex
@client.log(:warn, "Attempted connection to node #{host_string} raised " +
"#{ex.class}: #{ex.message}")
close
end
end
end