-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:blpop
returns an exception when using sentinels
#1279
Comments
:blop
returns an exception when using sentinels:blpop
returns an exception when using sentinels
How timely. I just ran into this issue as well, but I'm not using the
|
Notice how irb(main):001> require 'redis'
=> true
irb(main):002> redis_sentinel = Redis.new(url: 'redis://mymaster', name: 'mymaster', sentinels: [ { host: 'localhost', port: 26379 }])
=> #<Redis client v5.2.0 for redis://127.0.0.1:6381>
irb(main):003> redis_sentinel._client
=> #<RedisClient redis://127.0.0.1:6381> irb(main):004> redis = Redis.new(url: 'redis://localhost:6381')
=> #<Redis client v5.2.0 for redis://localhost:6381>
irb(main):005> redis._client
=> #<Redis::Client redis://localhost:6381> In the Redis Sentinel case, Lines 22 to 28 in 13f3246
The latter increments the Lines 95 to 101 in 13f3246
However, this doesn't happen in I've validated that when I added a similar timeout mechanism to @byroot What do you think? Should |
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. To avoid code duplication, turn `CommandBuilder` into a class that holds the `read_timeout` and use to determine the socket timeout. Closes redis/redis-rb#1279
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. To avoid code duplication, turn `CommandBuilder` into a class that holds the `read_timeout` and use it to determine the socket timeout. Closes redis/redis-rb#1279
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. To avoid code duplication, turn `CommandBuilder` into a class that holds the `read_timeout` and use it to determine the socket timeout. Closes redis/redis-rb#1279
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. Closes redis/redis-rb#1279
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. Closes redis/redis-rb#1279
In redis/redis-rb#1279, we discovered that `redis-rb` properly returned `nil` when `timeout` was reached with no key present, but when connecting to Redis Sentinels, the client raised a `ReadTimeoutTimeout` error. This occurred because of a subtle difference in how `RedisClient` (from `redis-rb`) and `Redis::Client` (from `redis-client`) behaved. The former, which is used with standalone Redis, returned `nil` because the socket read timeout was incremented to the command timeout value (redis/redis-rb#1175). The latter did not have this, so the socket read timeout would get triggered before the actual Redis timeout hit. To make the behavior consistent, increment the configured read timeout to the command timeout. Closes redis/redis-rb#1279
redis-rb/redis-client#197 should fix this. |
The documentation says
:blpop
should returnnil
when timed out. However when connecting to sentinels, timing out raises aRedisClient::ReadTimeoutError
.I wrote this script to reproduce it:
The problem comes from the
hiredis-client
gem which actually raises an exception for sentinels but returnsnil
for single redis instances. So this is probably affecting other blocking commands.The text was updated successfully, but these errors were encountered: