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

Error handling when Redis is not reachable #210

Open
ff-parasp opened this issue Jun 18, 2019 · 1 comment
Open

Error handling when Redis is not reachable #210

ff-parasp opened this issue Jun 18, 2019 · 1 comment

Comments

@ff-parasp
Copy link

We have configured message bus in our platform, it has been observed when redis is down our logs files are getting populated with following message, It tries to connect redis after regular interval of time, is there any way we can increase time interval so that there would be less occurrence in log file?

Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) subscribe failed, reconnecting in 1 second. Call stack ["/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:353:in rescue in establish_connection'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:336:in establish_connection'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:104:in block in connect'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:299:in with_reconnect'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:103:in connect'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:279:in with_socket_timeout'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/client.rb:136:in call_loop'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/subscribe.rb:43:in subscription'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis/subscribe.rb:12:in subscribe'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis.rb:3474:in _subscription'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis.rb:2293:in block in subscribe'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis.rb:50:in block in synchronize'", "/usr/share/rvm/rubies/ruby-2.4.3/lib/ruby/2.4.0/monitor.rb:214:in mon_synchronize'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis.rb:50:in synchronize'", "/home/x/.rvm/gems/ruby-2.4.3/gems/redis-4.1.0/lib/redis.rb:2292:in subscribe'", "/home/x/.rvm/gems/ruby-2.4.3/gems/message_bus-2.2.0/lib/message_bus/backends/redis.rb:287:in global_subscribe'", "/home/x/.rvm/gems/ruby-2.4.3/gems/message_bus-2.2.0/lib/message_bus.rb:721:in global_subscribe_thread'", "/home/x/.rvm/gems/ruby-2.4.3/gems/message_bus-2.2.0/lib/message_bus.rb:669:in block in new_subscriber_thread'"]

@SamSaffron
Copy link
Member

This is not configurable but you could define a custom logger that suppresses today.

https://github.com/SamSaffron/message_bus/blob/e2caee337ddf3ad09bba5c29b43be5219d2962eb/lib/message_bus/backends/redis.rb#L322

I do support a new config setting for the backend to tweak that number up or down.

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

No branches or pull requests

2 participants