Skip to content

config-reloader: exit early if --only-init-config is set#1787

Open
AndrewChubatiuk wants to merge 2 commits intomasterfrom
config-reloader-init-only-mode-fix
Open

config-reloader: exit early if --only-init-config is set#1787
AndrewChubatiuk wants to merge 2 commits intomasterfrom
config-reloader-init-only-mode-fix

Conversation

@AndrewChubatiuk
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Feb 5, 2026

fixes #1785


Summary by cubic

Ensure config-reloader exits after the initial config update when --only-init-config is set, so it doesn’t start background watchers or resyncs. Fixes the unexpected long-running behavior from #1785.

  • Bug Fixes
    • In only-init mode, run a single load and exit; do not start file/Kubernetes/dir watchers or resync tickers.
    • Use the resync-interval flag consistently (resyncInterval) to create the resync ticker.
    • Add changelog entry for the fix.

Written for commit dd7cc0e. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:30">
P3: The changelog links to a non-existent `cmd/config-reloader/README.md`, which will 404. Update the link to an existing document or directory (e.g., the config-reloader folder) so documentation links remain valid.</violation>

<violation number="2" location="docs/CHANGELOG.md:30">
P2: Rule violated: **Changelog Review Agent**

Changelog entry violates the required structure by omitting explicit before/after behavior and user-visible improvement, and it describes a fix that only affects the narrow --only-init-config flag audience rather than the majority of users. The entry must be rejected under the Changelog Review Agent rules.</violation>
</file>

<file name="cmd/config-reloader/file_watch.go">

<violation number="1" location="cmd/config-reloader/file_watch.go:67">
P2: The new early return skips `fw.wg.Done()`, so `close()` can hang forever when `--only-init-config` is set and the initial update succeeds. Ensure the waitgroup is decremented before returning.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@AndrewChubatiuk AndrewChubatiuk force-pushed the config-reloader-init-only-mode-fix branch 4 times, most recently from de3c1a6 to 50c36b7 Compare February 5, 2026 13:26
@AndrewChubatiuk
Copy link
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Feb 5, 2026

@cubic-dev-ai review this PR

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="cmd/config-reloader/file_watch.go">

<violation number="1" location="cmd/config-reloader/file_watch.go:42">
P2: Initial load treats nil previous content as equal to an empty config file, so only-init mode fails if the config file/secret is empty. Skip the equality check on the first load so an empty config is still written and treated as successful.</violation>
</file>

<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:32">
P2: Rule violated: **Changelog Review Agent**

Changelog entry does not follow the required structure: it lacks an explicit before/after user-centric explanation of the behavior change. The rule requires stating how it worked before and what changed now.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@AndrewChubatiuk AndrewChubatiuk force-pushed the config-reloader-init-only-mode-fix branch from e4f50c2 to 0931de4 Compare February 5, 2026 13:53
@AndrewChubatiuk AndrewChubatiuk force-pushed the config-reloader-init-only-mode-fix branch from 27f2182 to 18faf37 Compare February 5, 2026 14:03
Signed-off-by: Andrii Chubatiuk <achubatiuk@victoriametrics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configReloaderExtraArgs with resync-interval is applied to init container, potentially causing zombie processes

2 participants