-
Notifications
You must be signed in to change notification settings - Fork 1k
Concurrency issue in redis-rb 4.6.0 (using redis-namespace) #1088
Copy link
Copy link
Closed
resque/redis-namespace
#192Description
With the upgrade of redis-rb from 4.5.1 to 4.6.0 we started observing ocasional odd behavior under load:
A non-pipelined redis.evalsha(sha, keys, args) returning a Redis::Future instead of a String causing an error when the application tries to parse it.
And occasionally at the same time but in a different thread we noticed a misbehavior when a pipelined exists? wrongly evaluates to true.
(open, half_open) = execute_redis_pipeline { |pipeline|
pipeline.exists?(open_key(name))
pipeline.exists?(half_open_key(name))
}
# Both should be false according to our observability metrics
# For reference:
def execute_redis_command
yield
rescue Redis::BaseError => e
raise CircuitBreakerError.new(e.message, e)
end
def execute_redis_pipeline(&block)
execute_redis_command { redis.pipelined(&block) }
endAlthough relatively rare they seem related with the redis-rb gem upgrade, since we updated our pipelines and sidekiq dependency to avoid deprecation warnings 1 week before upgrading redis-rb, without problem.
Using:
Ruby 3.0.1
connection_pool (2.2.5)
redis (4.6.0) (default driver, w/ redis sentinel, no cluster)
redis-namespace (1.8.1)
sidekiq (6.4.1)
sidekiq-pro (5.3.1)
newrelic_rpm (7.2.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels