flyerhzm/redis-sentinel — pull request #3 by dplummer (2013-01-29 20:16:39+00:00)
Title: Memoizing sentinel client prevents leaking conns

Before, a new connection would be established to the sentinel each time
you tried to discover master and then it leaked. If you are doing that a
lot, it results in an error Errno::EMFILE too many open files.

This code lazily caches the sentinel connections as they are needed.