Delete special handling of blocking command timeouts #306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using a command like BLPOP, there are two timeouts: The one which is "how long will i wait on this socket before raising a ReadTimeout error", and the one which is "how long will I ask the Redis server to block before it returns nil".
redis-client lets you specify the two directly:
But obviously you should be waiting on the socket for longer than you're asking Redis to wait. redis-rb handles this directly itself here: https://github.com/redis/redis-rb/blob/935f64f18d7c37386e9b01db71683f8f3b868cd2/lib/redis/client.rb#L95-L106
So, when using blocking commands in redis-rb, you always get nil, not a timeout error:
Thus, I think we should actually just not ignore timeouts on blocking commands at all; all timeout errors are bad timeout errors, and:
Also, I had to delete the circuit breaker tests. In reality, this is totally broken, since we respond to literally any connection error by entirely dumping all Redis connections and starting from scratch. The new connections won't have their circuit breaker counts carried over. I think we might need to make cluster-client maintain it's own circuit breakers per-node-key; this is something I can look at in the future perhaps.