Skip to content

fix(redis): default sentinel ports per address#4697

Open
haoshengzhen wants to merge 1 commit into
OffchainLabs:masterfrom
haoshengzhen:my_feature
Open

fix(redis): default sentinel ports per address#4697
haoshengzhen wants to merge 1 commit into
OffchainLabs:masterfrom
haoshengzhen:my_feature

Conversation

@haoshengzhen

Copy link
Copy Markdown

Summary

When parsing redis+sentinel URLs with multiple sentinel addresses, an address without an explicit port used the full URL host list as its host fallback. For example:

redis+sentinel://sentinel-1,sentinel-2:26379/master

could produce an invalid first address instead of defaulting only sentinel-1 to port 6379.

This change applies the missing-port fallback per sentinel address, preserving explicitly configured ports on the other addresses. It also adds a regression test and a changelog fragment.

Testing

  • gofmt
  • git diff --check
  • Temporary Go reproduction confirming the old address parsing logic fails for mixed explicit/default sentinel ports, while the new logic returns sentinel-1:6379 and sentinel-2:26379.

Signed-off-by: haoshengzhen <haoshengzhen@outlook.com>
@CLAassistant

CLAassistant commented Jun 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@haoshengzhen

Copy link
Copy Markdown
Author

@bragaigor Hi, Could you please review this PR at your convenience? Thank you very much.

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