Skip to content

feat(discov): expose etcd AutoSyncInterval in EtcdConf - #5676

Open
Vierblatt wants to merge 4 commits into
zeromicro:masterfrom
Vierblatt:feat/etcd-autosync-interval
Open

feat(discov): expose etcd AutoSyncInterval in EtcdConf#5676
Vierblatt wants to merge 4 commits into
zeromicro:masterfrom
Vierblatt:feat/etcd-autosync-interval

Conversation

@Vierblatt

Copy link
Copy Markdown
Contributor

Summary

Adds AutoSyncInterval field to EtcdConf, allowing users to configure the etcd client auto sync interval. When set (>0), it overrides the default via per-cluster registration, matching the existing pattern of RegisterAccount and RegisterTLS.

Etcd:
  Hosts:
    - 127.0.0.1:2479
  Key: device.rpc
  AutoSyncInterval: 0s  # disables auto-sync

Motivation

Fixes #5619. go-zero's etcd discovery creates the etcd client internally, so users cannot control AutoSyncInterval today. This matters when applications should keep using the configured Etcd.Hosts, such as an etcd LB / VIP / proxy (related: #5005).

Test plan

  • All existing discov tests pass
  • All existing zrpc tests pass
  • Build successful
  • Field is optional (zero value = use default behavior)
Allows users to configure the etcd client auto sync interval via
EtcdConf.AutoSyncInterval. When set (>0), it overrides the default
at etcd client level via per-cluster registration, matching the
existing pattern of RegisterAccount and RegisterTLS.

Fixes zeromicro#5619
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/discov/internal/registry.go 0.00% 1 Missing and 1 partial ⚠️
zrpc/internal/rpcpubserver.go 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant