Open nickcoyne opened 1 month ago
This is my full sidekiq config:
require 'sidekiq'
require 'sidekiq-unique-jobs'
redis_options = {
network_timeout: 5
}
Sidekiq.configure_client do |config|
config.redis = redis_options
config.client_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Client
end
end
Sidekiq.configure_server do |config|
config.redis = redis_options
config.client_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Client
end
config.server_middleware do |chain|
chain.add SidekiqUniqueJobs::Middleware::Server
end
# # This is a workaround for redis connection issues on boot.
Thread.new do
sleep 2
SidekiqUniqueJobs::Server.configure(config)
end
end
Describe the bug
I have a strange startup bug with this error:
Unsupported command argument type: Array
Expected behavior
Sidekiq starts without issue
Current behavior
Sidekiq startup fails.
Additional context
I'm upgrading my Rails 6.1.7.8 application to use Sidekiq 7 and friends (previously sidekiq 6.5.12, and sidekiq-unique-jobs 7.1.33, now sidekiq 7.3.0 and sidekiq-unique-jobs 8.0.10).
On sidekiq worker boot it fails with
Unsupported command argument type: Array
It is raised from
vendor/bundle/ruby/3.2.0/gems/redis-client-0.22.2/lib/redis_client/command_builder.rb:37
Locally, if I delay sidekiq startup to occur a few seconds after redis startup, then the error does not occur. This also works by delaying the in the sidekiq config like so:
However that doesn't seem to help with my Heroku restarts where I still get the error. Manually restarting the worker on Heroku usually works, although sometimes with this error:
which is coming from
vendor/bundle/ruby/3.2.0/gems/sidekiq-7.3.0/lib/sidekiq/config.rb:148
If I omit the
SidekiqUniqueJobs::Server.configure(config)
completely, then there are no startup issues.Running ruby 3.2.4. Redis versions are 7.2.5 locally and 6.2.8 on Heroku.