fix(dependson): fallback to unsorted enqueue on circular dependency - #1725
Open
AruneshDwivedi wants to merge 2 commits into
Open
fix(dependson): fallback to unsorted enqueue on circular dependency#1725AruneshDwivedi wants to merge 2 commits into
AruneshDwivedi wants to merge 2 commits into
Conversation
added 2 commits
August 30, 2026 04:20
sortAndEnqueue returns nil when dependency.Sort detects a circular dependency, which drops ALL reconciliation requests for the source — including Kustomizations not part of the cycle. This silently disables event-driven reconciliation for the entire source. Fix by falling back to unsorted enqueue on sort error. The ordering is an optimization; out-of-order reconciles are handled by the DependencyNotReady requeue mechanism. Signed-off-by: Arunesh Dwivedi <arunesh@example.com>
Deferred os.RemoveAll calls in reconcile do not run on SIGKILL or os.Exit(1), leaving orphaned kustomization-* directories in /tmp. These accumulate across restarts and can consume significant ephemeral storage (or memory when /tmp is tmpfs). Add sweepStaleTmpDirs() called before mgr.Start() to clean leftover dirs from ungraceful exits. Signed-off-by: Arunesh Dwivedi <arunesh@example.com>
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.
fix(dependson): fallback to unsorted enqueue on circular dependency
When two or more Kustomizations referencing the same source form a
dependsOncycle,sortAndEnqueueinkustomization_indexers.goreturnsnil, which drops ALL reconciliation requests for that source — including Kustomizations not part of the cycle. This silently disables event-driven reconciliation for the entire source, with only a log line as evidence.The topological ordering in
sortAndEnqueueis an optimization. Out-of-order reconciles are already handled correctly by theDependencyNotReadyrequeue mechanism. Returningnilon sort error provides no correctness guarantee — a graceful fallback to unsorted enqueue loses nothing.This PR changes
sortAndEnqueueto fall back to unsorted enqueue whendependency.Sortreturns an error (e.g. circular dependency), instead of dropping all requests.Fixes #1712