flyerhzm / redis-sentinel

another redis automatic master/slave failover solution for ruby by using built-in redis sentinel (deprecated)
MIT License
188 stars 67 forks source link

Fix for pipelined requests and readonly calls with slightly different error message. #36

Closed Excds closed 10 years ago

Excds commented 10 years ago

We had a problem with resque and redis-sentinel. Since resque apparently uses pipelined requests, I aliased the pipelined call and also added timeouts to calls.

Also, in some cases (i.e. with redis-scheduler) the Redis:CommandError error message is prepended by another error string, so it looked like this: ERR Error running script (call to f_8f4a4e422bfa8f9a0931e350d6e30b1c3ce97c33): @user_script:1: @user_script: 1: -READONLY You can't write against a read only slave

So, I did a more relaxed check on the error message.

Excds commented 10 years ago

Do you want to merge?

flyerhzm commented 10 years ago

yes, sure, seems I didn't get notify for your updates, sorry for delay.

Excds commented 10 years ago

:-)