Skip to content

v2.6.8

Latest

Choose a tag to compare

@dobyte dobyte released this 16 Nov 05:40

Highlights

  • Config core restructure: the configurator, options, source and matcher implementations now live in core/config, while github.com/dobyte/due/v2/config remains a public facade; wildcard file matching moved from core/pattern into core/config (6a9e1deb).
  • Config reliability: sources that fail at startup are retried in the background, stopped or failed watchers reopen with capped backoff, callbacks are serialized and panic-isolated, and reloads publish only values that actually changed (3a4691ff, c4c2e957, 17303914, 44a9f9fd, 53842e0d, ad0c706b, 066541c2).
  • File selection for every source: all config sources accept a files list with * wildcards, and explicit Load/Store entries are validated so they can no longer address wildcards, empty names or unconfigured files (7c498218, f81c08bd, 68571f23, 42b2ab4b, d1a2bfbc, 7822ecba, 6cf928ba).
  • Smaller registry payloads: route metadata is compressed into flag ranges for Consul, Nacos and Polaris (437cbf05, 2717c174, 24f7281a).

Breaking Changes

  • The wildcard helpers moved from github.com/dobyte/due/v2/core/pattern to github.com/dobyte/due/v2/core/config, and the config core implementation moved from config to core/config; update direct imports accordingly (6a9e1deb).
  • Configurations loaded from Nacos or Polaris nested dataIds are now keyed by their base name instead of the full dataId. Read them by base name and avoid duplicate base names under different paths (c4c2e957).
  • consul.WithContext was removed; the configurator now passes its context to Source.Load and Source.Watch (3a4691ff).

Config

  • Recover sources and watchers from failures: retry startup loads in the background, reopen failed or stopped watchers with capped exponential backoff, isolate callback panics and cap Set slice expansion (3a4691ff, 44a9f9fd, ea0a0e33).
  • Serialize watch callbacks, publish only changed configurations, replace changed configs as a whole and coordinate background reload retries (ad0c706b, 066541c2, 53842e0d, 17303914).
  • Reject closed sources, skip the initial Consul sync, ignore duplicate sources and serialize close with in-flight operations (778a7c23, 13eec710, feee9c87, c4c2e957).
  • Validate explicit load entries in every source, validate store entries, decode scalar roots, reject wildcards in concrete entries and empty store names, and ignore nil watch callbacks (42b2ab4b, 6cfb92a7, d1a2bfbc, 7822ecba, 6cf928ba).
  • Add the files option to the file source, normalize file lists, load files from newly created directories and share wildcard matching across sources (7c498218, 36c0919c, 334c34d0).
  • Require callers to install the core logger, decouple facade logging from etc, add a package-local etc logger and rename its adapter (a8d70cf5, 17b66013, 0adbc705).
  • Narrow write copies during Store and clarify load/merge semantics (3410d329, c25b8584).

Config Sources

  • Nacos: add a fixed config file list and * wildcard support, register fixed-list listens once, retry failed fixed-file listeners, enforce the blur prefilter, send wildcard entries as blur patterns, constrain explicit load/store to configured files and harden auth, caching and lifecycle handling (b3c4b46e, 5efc2b31, 68571f23, 50b169ba, 576cbae8, 8c027d8c, 0fa84059, 6458c397); drop the verbose v3 login success log (79dcab4f); document usage and matching rules (f9d4ee2e).
  • Polaris: make cache and log directories configurable, load a fixed file list directly, retry fixed-file subscriptions, simplify store branches and upgrade polaris-go to v1.7.2 (326cbf79, 0ed23276, b5356a88, 80572e32).
  • Consul / etcd: add the files option and scope the etcd timeout option to watcher reads (f81c08bd, b064d739).

Registry

  • Consul: compress route metadata into range chunks (2717c174).
  • Nacos: encode routes as compact flag ranges, keep the routing snapshot aligned with route limits, bound route decoding and isolate invalid instances (24f7281a, 3f5ea34b, b6151d1f).
  • Polaris: skip invalid instances, add default cache/log directories, configure SDK loggers once, avoid resetting configured SDK loggers and upgrade polaris-go to v1.7.2 (0fa15e73, 83181946, 0b83f45d, 361acd9e).
  • Centralize route errors and harden config source and registry lifecycles (437cbf05, 7ce097c3).

Core Libraries

  • value: decode JSON with single-pass byte scanning, reduce scanning allocations and interface boxing, and support default tags and cross-type scanning (4e21680b, 5230d8fc, e17a3337).
  • encoding/json: align omitempty with sonic for false and zero values (716392bb).
  • Adopt WaitGroup.Go for managed goroutines and remove underscore-prefixed identifiers (2ffde8b6, b8bbfd43).

Dependencies

  • Bump bytedance/sonic to v1.15.5 and sonic/loader to v0.5.3 in the root module and all nested modules (3a4691ff).
  • Upgrade polaris-go to v1.7.2 in the config and registry Polaris modules (80572e32, 361acd9e).
  • Bump the framework version to v2.6.8 and align all 29 component modules (50de39a5).

Documentation

  • Add the distributed job system design and align the config merge-only semantics across the harness notes (93a7e62f, c25b8584).

Full Changelog: v2.6.7...v2.6.8