This error makes no sense because brpoplpush
in Ruby Redis 5.0.5 expects three arguments, and Sidekiq Pro 5.5.2 calls brpoplpush
with three arguments on line 355 of lib/sidekiq/pro/super_fetch.rb:
result = conn.brpoplpush(queue, working_queue, config[:fetch_timeout] || 1)
Here is the error in Sentry:
From our Gemfile.lock:
sidekiq-pro (5.5.2)
sidekiq (>= 6.5.0)
redis (5.0.5)
redis-client (>= 0.9.0)
2
Answers
The signature on that method includes a named argument
timeout
which defaults to 0. Ruby will accept a hash at end of the list of arguments, but not an Integer or similar.I suspect
config[:fetch_timeout]
is nil, therefore the value of1
is being passed, thus the error message.Maybe see where
config[:fetch_timeout]
is being set and make sure it contains a hash value like{ timeout: 1 }
.If you want to get your head around why you get that particular error message, consider this method:
Calling
foo(1, 1)
will trigger a(wrong number of arguments (given 2, expected 1))
error, whereasfoo(1, test: 2)
will work.Yes, the issue you’re seeing is a gem incompatibility.
If you upgrade to sidekiq 6.5.8, the redis version will be constrained automatically: