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

Upgrade HostProvider #6

Merged
merged 8 commits into from
Feb 2, 2024
Merged

Upgrade HostProvider #6

merged 8 commits into from
Feb 2, 2024

Conversation

PapaCharlie
Copy link
Member

This change fixes the behavior of DNSHostProvider where it does not refresh its cached IP addresses that it resolves once on startup for the configured ZK servers. This new behavior more closely matches the Java client's behavior by randomly selecting an address after resolving the host. It slightly changes the semantics of HostProvider with an off-by-one, otherwise the connect loop could end up in a situation where it attempts to connect to a stale address. This is fixed by moving the backoff to before getting the address, rather than after.

This change fixes the behavior of DNSHostProvider where it does not refresh its cached IP addresses that it resolves once on startup for the configured ZK servers. This new behavior more closely matches the Java client's behavior by randomly selecting an address after resolving the host. It slightly changes the semantics of `HostProvider` with an off-by-one, otherwise the `connect` loop could end up in a situation where it attempts to connect to a stale address. This is fixed by moving the backoff to _before_ getting the address, rather than _after_.
@bohhyang
Copy link

bohhyang commented Feb 2, 2024

original review for reference: #5 (review)

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

staticdnshostprovider.go Outdated Show resolved Hide resolved
staticdnshostprovider.go Outdated Show resolved Hide resolved
staticdnshostprovider.go Outdated Show resolved Hide resolved
@PapaCharlie PapaCharlie merged commit 4dc0808 into master Feb 2, 2024
4 of 6 checks passed
PapaCharlie added a commit that referenced this pull request Feb 5, 2024
* Upgrade HostProvider

This change fixes the behavior of DNSHostProvider where it does not refresh its cached IP addresses that it resolves once on startup for the configured ZK servers. This new behavior more closely matches the Java client's behavior by randomly selecting an address after resolving the host. It slightly changes the semantics of `HostProvider` with an off-by-one, otherwise the `connect` loop could end up in a situation where it attempts to connect to a stale address. This is fixed by moving the backoff to _before_ getting the address, rather than _after_.

* Bump linter version to support generics

* Fix linter and integration test actions

* Add docs
trvrnrth added a commit to bugsnag/Burrow that referenced this pull request Jul 8, 2024
The primary driver behind this is to be able to make use of the new
default host provider added in linkedin/go-zk#6
to resolve connection issues when zookeeper host IPs change.
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.

4 participants