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

Add exception type for READONLY errors #1943

Closed
anothertobi opened this issue Dec 22, 2021 · 0 comments
Closed

Add exception type for READONLY errors #1943

anothertobi opened this issue Dec 22, 2021 · 0 comments
Labels
type: feature A new feature
Milestone

Comments

@anothertobi
Copy link
Contributor

Feature Request

Add a distinct exception type for READONLY errors so that users can handle these in a clean way.

Is your feature request related to a problem? Please describe

With some Redis setups (e.g. HAProxy abstracting Redis/Sentinel setup), clients are forced to handle failovers by re-creating their connection when they receive READONLY errors.

Describe the solution you'd like

From io.lettuce.core.internalExceptionFactory:

Specific Redis error messages may create subtypes of {@link RedisCommandExecutionException}.

Therefore I'd like to have a RedisReadOnlyException, similar to the existing RedisLoadingException.

Describe alternatives you've considered

Clients can already handle this by checking the message of a RedisCommandExecutionException for READONLY.

Teachability, Documentation, Adoption, Migration Strategy

Users can implement custom code based on the new exception type.

@mp911de mp911de added this to the 6.1.6 milestone Jan 3, 2022
@mp911de mp911de added the type: feature A new feature label Jan 3, 2022
@mp911de mp911de changed the title Add exception type for READONLY errors Add exception type for READONLY errors Jan 4, 2022
mp911de pushed a commit that referenced this issue Jan 4, 2022
Redis instances in read-only mode will reply with a `READONLY` error
message when a write is attempted. This change allows users to
specifically handle these errors.

Original pull request: #1944.
mp911de added a commit that referenced this issue Jan 4, 2022
Add author and since tags.

Original pull request: #1944.
mp911de pushed a commit that referenced this issue Jan 4, 2022
Redis instances in read-only mode will reply with a `READONLY` error
message when a write is attempted. This change allows users to
specifically handle these errors.

Original pull request: #1944.
mp911de added a commit that referenced this issue Jan 4, 2022
Add author and since tags.

Original pull request: #1944.
@mp911de mp911de closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants