Skip to content

Fix Announce Regression #1171

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
merged 4 commits into from
Apr 14, 2025
Merged

Conversation

vazois
Copy link
Collaborator

@vazois vazois commented Apr 14, 2025

Fix regression for cluster announce endpoint when using IPEndPoint.Any

@Copilot Copilot AI review requested due to automatic review settings April 14, 2025 17:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a regression for the cluster announce endpoint when using IPEndPoint.Any by refining the endpoint resolution logic and adding a dedicated test.

  • Adds a new test (ClusterAnyIPAnnounce) that exercises the announce behavior using IPAddress.Any.
  • Updates the endpoint creation in StoreWrapper to use localEndPoint.Port for both IPv4 and IPv6 resolution.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
test/Garnet.test.cluster/ClusterConfigTests.cs New test added to validate announce endpoint behavior using IPAddress.Any.
libs/server/StoreWrapper.cs Modified endpoint construction to use localEndPoint.Port, fixing the regression bug.
Files not reviewed (1)
  • Version.props: Language not supported
Comments suppressed due to low confidence (3)

test/Garnet.test.cluster/ClusterConfigTests.cs:141

  • [nitpick] Consider renaming the test method to 'ClusterAnyIPAnnounceTest' for consistency with the naming conventions observed in the test suite.
public void ClusterAnyIPAnnounce()

libs/server/StoreWrapper.cs:297

  • [nitpick] Add an inline comment to clarify why 'localEndPoint.Port' is used instead of 'endPoint.Port', as this change may be non-obvious to future readers.
return new IPEndPoint(endPoint.Address, localEndPoint.Port);

libs/server/StoreWrapper.cs:306

  • [nitpick] Similarly, add a comment explaining the rationale for using 'localEndPoint.Port' in the IPv6 resolution block to improve code clarity.
return new IPEndPoint(endPoint.Address, localEndPoint.Port);

@vazois vazois merged commit 14fb5f9 into microsoft:main Apr 14, 2025
26 checks passed
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