# File lib/mongo/util/pool_manager.rb, line 101 def read_pool(mode=@client.read, tags=@client.tag_sets, acceptable_latency=@client.acceptable_latency) pinned = thread_local[:pinned_pools][self.object_id] if pinned && pinned.matches_mode(mode) && pinned.matches_tag_sets(tags) && pinned.up? pool = pinned else pool = select_pool(mode, tags, acceptable_latency) end unless pool raise ConnectionFailure, "No replica set member available for query " + "with read preference matching mode #{mode} and tags matching #{tags}." end pool end