Tags: jspark-icon/go-zk
Tags
Use net.JoinHostPort instead of raw string concatenation (linkedin#7) When adding a port to an IPv6 address, it must be wrapped with [...].
Improve logging and error handling, (linkedin#5) * Improve logging and error handling This overhauls the logging and error responses from the *Conn. Namely, it changes the logging backend to `log/slog` which makes it easier to manage the library's logging centrally (however the old functionally to provide a custom logger is retained). It also captures the reason why a specific connection to a ZK server was closed in the error that is propagated to all callers. This can be checked with `errors.Is`. This also adds an exponential backoff feature to the client, which will make it back off when reconnecting to a ZK server. * Remove logger option, it messes with the logging * Change default behavior of DNSHostProvider * Split implementation of HostProvider, fix up tests
Upgrade HostProvider (linkedin#6) * 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
Generify EventQueue (linkedin#4) This data structure has many other applications, especially when dealing with ZK.
Add timestamp field on Event (linkedin#3) This field can be used to track the end-to-end time in between receiving the event and actually processing it. Since events end up in a queue, it's hard to tell how far behind the consumer on the EventQueue is, and this timestamp can be used to track that.