-
Notifications
You must be signed in to change notification settings - Fork 2
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
Not timing out or Errno::EADDRNOTAVAIL #1
Comments
@scalp42 Thanks a lot for testing this and for discovering those issues! I think I'll be able to take a look at this tomorrow, as today I'll be very busy. I saw your pull request too, the change makes perfect sense of course :-) I'll apply that change locally and check the rest of the issues tomorrow morning. Again, thanks a lot for your help! |
No worries, very grateful for all your work as always 😄 |
UPDATE: I also tested with a proper Redis setup (meaning the Redis instances are reachable directly) and I noticed it takes a long time to failover on client side. Running a script which constantly pushes updates to Redis using Redisent, with 3 Redis nodes on ports 6380 to 6382 (Sentinel nodes on ports 26391/92/93):
When I look on the Sentinel side, the failover happens fast but somehow Redisent doesn't necessarily pick it up immediately. I was thinking that as soon as a new master is elected, Redisent switches to the new ones. Just thoughts right now, probably missing something or I could be totally wrong 🍶 Another test:
I'm hoping it makes sense but in that case the connection can hang forever if I sleep 2000 secs for example, it never times out even though Sentinel already elected a new master after 5 secs. |
I also tested using docker pause directly:
The code leverages Ost with Redisent (I could be doing this wrong): require 'ost'
require 'redisent'
begin
sentinels = cli.config[:sentinel_hosts]
redis = Redisent.new(hosts: sentinels, name: 'mymaster')
Ost.redis = redis
queue = cli.config[:redis_key]
payload = { 'type' => 'ami_update' }
Ost[queue] << JSON.dump(payload)
logger.debug %|#{plugin} => Pushed #{plugin}::#{updated.join(',')} to #{Ost.redis.url}|
rescue Errno::ECONNREFUSED, Errno::EINVAL
logger.error %|#{plugin} => Could not connect to #{cli.config[:redis_url]}|
rescue Redisent::UnreachableHosts => ex
logger.error %|#{plugin} => Cannot talk to Sentinel hosts, #{ex.message}|
rescue Redisent::UnknownMaster => ex
logger.error %|#{plugin} => Cannot talk to Sentinel master, #{ex.message}|
end I added some debugging and can confirm when using Ost it times out: logger.debug %|#{plugin} => About to put in Ost queue|
Ost[queue] << JSON.dump(payload)
logger.debug %|#{plugin} => Put in Ost queue|
|
Hi @soveran,
I finally got around to switching to a proper Sentinel setup. While testing, I'm running into a couple issues.
Current setup is a Docker VM through Virtualbox (
192.168.99.100
) with 3 Redis instances and 3 Sentinel instances.The Sentinel instances are configured to advertise their IP as the VM host (not Docker
172.x
), meaning that the Redis instances are not reachable from localhost (just the Sentinel ones).The idea was to test on the client side exception and what not:
I also created a "classic" Redic connection to match the
redis.prime
object:Now testing Redic timeouts, working as intended:
But if I try through Redisent, it can sometimes take forever to timeout or just not work while trying to talk to Sentinel:
Nothing show up in Sentinel logs in case:
Granted the Redis instances should be reachable but I'm not sure why this is happening when using Redisent.
Any help would be appreciated, thanks in advance 😄
The text was updated successfully, but these errors were encountered: