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

Ignore zero addresses in CLUSTER SLOTS response #31

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

mxmsk
Copy link
Contributor

@mxmsk mxmsk commented Sep 18, 2024

Skip CLUSTER SLOTS elements if address is empty and port is zero.
Also, added happy-path test for CLUSTER SLOTS

@mxmsk mxmsk requested a review from g7r September 18, 2024 10:57
host, hasHost := rawaddr[0].([]byte)
port, hasPort := rawaddr[1].(int64)
if !hasHost && hasPort && port == 0 {
// fallback to skip zero address
Copy link
Contributor

@g7r g7r Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave a message explaining the source of this fallback:

Due to possible Redis cluster misconfiguration we can receive zero address for one of the replicas.
It is totally fine to skip the misconfigured replica and go with the remaining ones without inducing denial of service.

@mxmsk mxmsk merged commit 4dd4738 into master Sep 18, 2024
6 checks passed
@mxmsk mxmsk deleted the feature/ignore-zero-address branch September 18, 2024 16:15
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.

2 participants