Skip to content

feat: add automatic config reload polling - #1067

Open
houyuwushang wants to merge 2 commits into
trickstercache:mainfrom
houyuwushang:feat/auto-config-reload-904
Open

feat: add automatic config reload polling#1067
houyuwushang wants to merge 2 commits into
trickstercache:mainfrom
houyuwushang:feat/auto-config-reload-904

Conversation

@houyuwushang

@houyuwushang houyuwushang commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #904.

Adds opt-in configuration polling through mgmt.auto_reload_interval. The watcher checks file staleness before invoking the existing graceful reload path, so unchanged polls do not increment reload-attempt metrics or engage the reload rate limiter. A successful reload publishes the new configuration back to the watcher, allowing the interval to be changed or disabled without restarting Trickster.

The default remains 0s (disabled), negative intervals are rejected, and the projected-volume test covers the trickster.yaml -> ..data/trickster.yaml symlink swap used by Kubernetes ConfigMaps. The configuration examples now also use the current mgmt section and reload field names.

Validation:

  • focused config and auto-reload tests repeated 20-50 times
  • race-enabled config, daemon, and reload-handler tests
  • go vet ./pkg/config/... ./pkg/daemon and incremental golangci-lint
  • Linux daemon-package cross-compilation and vet
  • Windows binary build and full example-config validation
  • real-process smoke test: a 250ms watcher reloaded a file change, then a reloaded 0s interval prevented a subsequent change from reloading

Type of Change

  • Bug fix
  • New feature
  • Optimization
  • Test coverage
  • Documentation
  • Infrastructure

AI Disclosure

  • This contribution DOES NOT include AI-generated changes
  • This contribution DOES include AI-generated changes, and I have reviewed the relevant contributing guidelines.

@houyuwushang
houyuwushang requested a review from a team as a code owner July 17, 2026 05:11
Comment thread examples/conf/example.full.yaml Outdated
Comment thread pkg/config/config.go Outdated
@jranson jranson added the 2.1 release feature slated for 2.1 release label Jul 17, 2026
@houyuwushang
houyuwushang force-pushed the feat/auto-config-reload-904 branch from 7faea96 to f6d983c Compare July 24, 2026 14:20
@houyuwushang

Copy link
Copy Markdown
Contributor Author

@jranson, could you re-review this when you get a chance? The requested configuration-key and empty-path changes are addressed, and the branch is rebased onto current main.

@jranson

jranson commented Jul 26, 2026

Copy link
Copy Markdown
Member

We're targeting this for the v2.1.0 release, so I'll give it a final review once v2.0.5 release (which includes the new aggregation items from #1068) lands

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
@houyuwushang
houyuwushang force-pushed the feat/auto-config-reload-904 branch from f6d983c to f6e64f0 Compare August 1, 2026 07:52
@houyuwushang

Copy link
Copy Markdown
Contributor Author

@jranson v2.0.5 is out now. I rebased this onto current main and resolved the release-line conflicts, so it should be ready for the final review you mentioned.

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

Labels

2.1 release feature slated for 2.1 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Can Trickster detect and reload configs automatically?

2 participants