Skip to content

Handle unresolved Sentinel master/replica error #183

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

Merged

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Mar 21, 2024

#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

redis-rb#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 redis-rb#182
@stanhu stanhu force-pushed the sh-fix-unresolved-sentinel-config branch from af20509 to 1322988 Compare March 21, 2024 16:58
@stanhu stanhu changed the title Handle unresolved Sentinel maste rerror Handle unresolved Sentinel master/replica error Mar 21, 2024
@casperisfine casperisfine merged commit 83babc4 into redis-rb:master Mar 22, 2024
@casperisfine
Copy link
Collaborator

Thank you

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

Successfully merging this pull request may close these issues.

New error message handling is broken when using sentinels
2 participants