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

If host and public_ip are same, always attempt connecting to host addresses #27

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

ashetkar
Copy link

@ashetkar ashetkar commented Feb 10, 2025

What

  • A user was facing an issue where the first connection attempt was getting stuck indefinitely causing the app to hang.
  • Its setup had a load balancer in between the nodes of the YugabyteDB cluster and client
  • The YugabyteDB cluster was configured such that the yb_servers() had the same value for host and public_ip columns for a given node and these addresses were accessible from the client as well.

Why

  • This was caused because while iterating over an enumeration of keys of the clusterInfoMap, the map itself was getting modified.
  • This caused the iteration loop to become endless, causing the app to hang
  • The fix is to modify the loop to iterate over copy of the keys of the clusterInfoMap so the modifications to the map do not affect the iteration.
  • Also, tell the driver to use host address if it is same as public_ip and the given address does not match with either.

Testing

  • The existing tests run fine
  • Manual testing - TODO

Copy link

@HarshDaryani896 HarshDaryani896 left a comment

Choose a reason for hiding this comment

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

LGTM.

@ashetkar ashetkar merged commit e66dc1e into master Feb 12, 2025
4 of 5 checks passed
@ashetkar ashetkar deleted the ce-866 branch February 12, 2025 04:27
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