redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
124 stars 60 forks source link

Handle unresolved Sentinel master/replica error #183

Closed stanhu closed 6 months ago

stanhu commented 6 months ago

https://github.com/redis-rb/redis-client/pull/178 introduced a regression that caused a ConnectionError to be thrown to the caller if the Sentinel master or replica could not be resolved.

When a ConnectionError is thrown, the error message handler would attempt to retrieve config.server_url, but this in turn causes another Sentinel resolution to be attempted.

We avoid this by adding a resolved? method that will indicate whether the config can be used. The error handler won't attempt to provide more details if the config has yet to be resolved.

Closes #182

casperisfine commented 6 months ago

Thank you