Closed rbroemeling closed 11 years ago
The redis-ha-test.rb script that I used to test this is here: https://gist.github.com/rbroemeling/6471941
The problem lies in this code:
def reconnect_with_sentinels
redis_sentinels.each do |config, sentinel|
sentinel.client.reconnect
end
reconnect_without_sentinels
end
alias reconnect_without_sentinels reconnect
alias reconnect reconnect_with_sentinels
If this is removed (so that reconnect is answered by the default Redis client reconnect, which just does disconnect/connect), and if the following is added in its place:
def disconnect_with_sentinels
redis_sentinels.each do |config, sentinel|
sentinel.client.disconnect
end
disconnect_without_sentinels
end
alias disconnect_without_sentinels disconnect
alias disconnect disconnect_with_sentinels
... then the problem seems to be solved.
In particularly, upon reconnect:
Sorry, #22 is a duplicate of this one -- just the PR for the changes that I describe above.
Hi,
Assuming a Redis Master -> Slave setup with two sentinels; if the sentinel that the redis-sentinel gem is currently connected to goes offline, the next call to client.reconnect will cause a stacktrace like the following: