Skip to content
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

Upgrade to Sidekiq 6.0.6 breaks test setups by requiring a running redis server in order to run rake tasks #4515

Closed
willhurley004 opened this issue Mar 27, 2020 · 6 comments

Comments

@willhurley004
Copy link

Ruby version: 2.5.7
Sidekiq

initializer

redis_conn = proc {
  Redis.new(url: ENV['REDIS_URL'], ssl: ENV['REDIS_SSL'], id: nil)
}

Sidekiq.configure_server do |config|
  config.redis = ConnectionPool.new(size: 12, &redis_conn)
end

Sidekiq.configure_client do |config|
  config.redis = ConnectionPool.new(size: 12, &redis_conn)
end

stacktrace

Traceback (most recent call last):
	26: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:103:in `flush_stats'
	25: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/sidekiq-6.0.6/lib/sidekiq.rb:94:in `redis'
	24: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
	23: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
	22: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
	21: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
	20: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
	19: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/sidekiq-6.0.6/lib/sidekiq.rb:97:in `block in redis'
	18: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:104:in `block in flush_stats'
	17: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
	16: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
	15: from /Users/billhurley/.rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/monitor.rb:235:in `mon_synchronize'
	14: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
	13: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis.rb:2416:in `block in pipelined'
	12: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:162:in `call_pipeline'
	11: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
	10: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:164:in `block in call_pipeline'
	 9: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:196:in `call_pipelined'
	 8: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
	 7: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
	 6: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
	 5: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
	 4: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
	 3: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
	 2: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
	 1: from /Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:343:in `establish_connection'
/Users/billhurley/.rvm/gems/ruby-2.5.7@calendar2/gems/redis-4.1.3/lib/redis/client.rb:362:in `rescue in establish_connection': Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)

Basically from what I can tell [this change] (v6.0.5...v6.0.6#diff-8b1e439c6fe15c4aaf01ec94660173f8R99) breaks rake in environments where redis is unavailable such as during docker builds.

@JamesChevalier
Copy link

Here's another version of your link (looks like a markdown formatting issue):
https://github.com/mperham/sidekiq/blob/4ca372160af2d28a96c2ef94059865866fbbdbe4/lib/sidekiq/launcher.rb#L99-L115

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2020

Please look at the change log or the last dozen issues.

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2020

And BTW, I suspect you can delete your entire initializer.

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2020

#4502

@mperham mperham closed this as completed Mar 27, 2020
@sarahgriffis
Copy link

@mperham We're having the same issue. Sorry, I'm not following what the fix is?

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2020

#4502 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants