flyerhzm/redis-sentinel — pull request #14 by mikegee (2013-08-22 18:53:58+00:00)
Title: Reconnect if your redis suddenly becomes read-only.

We had some transient network failures that caused Sentinel to switch masters on us, but our connected Redis client wasn't told to disconnect/reconnect, and so found itself connected to a readonly slave.

In [this discussion](https://groups.google.com/forum/#!searchin/redis-db/sentinel$20reconnect/redis-db/nb4o78CkhFk/R3Lhz5r1W5kJ) antirez suggests that clients should detect a -READONLY event and reconnect to the Sentinels, which is essentially what this patch does.