config-reloader: trigger reload after initial directory sync - #2528
Open
shunki-fujita wants to merge 3 commits into
Open
config-reloader: trigger reload after initial directory sync#2528shunki-fujita wants to merge 3 commits into
shunki-fujita wants to merge 3 commits into
Conversation
shunki-fujita
requested review from
AndrewChubatiuk and
vrutkovs
as code owners
August 21, 2026 06:35
shunki-fujita
marked this pull request as draft
August 21, 2026 06:36
shunki-fujita
force-pushed
the
config-reloader-initial-sync-reload
branch
from
August 21, 2026 06:54
3995a5a to
623729e
Compare
shunki-fujita
force-pushed
the
config-reloader-initial-sync-reload
branch
from
August 21, 2026 07:02
623729e to
e7629bb
Compare
shunki-fujita
marked this pull request as ready for review
August 21, 2026 07:06
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
vrutkovs
requested changes
Aug 21, 2026
vrutkovs
requested changes
Aug 26, 2026
vrutkovs
left a comment
Collaborator
There was a problem hiding this comment.
Needs CHANGELOG entry too
| if !synced { | ||
| continue | ||
| } | ||
| select { |
Collaborator
There was a problem hiding this comment.
My understanding is that we add the directory to the cache first time anyway, even if the sync succeeds? Perhaps we should change that assumption - and that would help us get rid of "infinite cycle to handle initial sync"?
We can update updateCache function to return newHash and set filesContentHashPath[baseDir] = newHash here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2527
Problem
Since v0.72.0, VMAlert reads its rule files from an emptyDir populated by the
config-initinit container and synced by theconfig-reloadersidecar. If the rules ConfigMap is updated between the init container's copy and the sidecar starting, the sidecar's initial sync writes the new content to the target dir but never notifies the application. The application keeps serving the snapshot it read at startup, and if the ConfigMap never changes again, no fsnotify event ever fires — the stale state is permanent.Fix
dirWatcher.start()sends one reload signal after the initial directory sync. This also applies to watch-only directories (no--target-dir): the same startup race exists there — a change landingbetween the application's first read and the watch being established produces no event — just with a smaller window.
Tests