Fix project creation delays caused by slow deletions#553
Merged
Conversation
Contributor
📝 Documentation AnalysisJoggr found 2 outdated docs in the pull request. AutofixJoggr opened 1 pull request(s) to fix the outdated docs. Outdated
|
The project controller reconciled all projects with a single worker goroutine. When a project was deleted, the synchronous purge operation (up to 10 minutes) blocked all other project reconciliation — including creation of new projects. Split the monolithic Purge() into StartPurge() (issues delete commands) and IsPurgeComplete() (checks if resources have drained). The controller now uses a condition-driven state machine (ResourceCleanup) that returns from each reconcile in seconds and requeues to poll for completion. Also increases MaxConcurrentReconciles to 4 for additional throughput. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
491dbde to
6fcb592
Compare
Adds a Chainsaw e2e test that verifies: - A project can be deleted after reaching Ready status - The project is fully removed from both org and main cluster contexts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Note
CI shows 6 failing e2e tests — these are pre-existing failures unrelated to this PR. See #549 for the fix.
Summary
ResourceCleanupstatus condition on the project, so operators can see exactly what phase the cleanup is in.What changed
The project controller previously ran a synchronous cleanup operation during deletion that could block for up to 10 minutes. During that time, no other project — including newly created ones — could be reconciled.
The cleanup is now split into two non-blocking steps: issuing delete commands (fast) and checking whether resources have drained (cheap poll). The controller tracks progress via a
ResourceCleanupcondition with three reasons:CleanupStarted→ delete commands are being issuedCleanupAwaitingCompletion→ waiting for resources to be removedCleanupComplete→ all resources removed, finalizer can be releasedIf resources haven't drained after a check, the controller transitions back to
CleanupStartedto automatically re-issue delete commands on the next reconcile.Test plan
task test:unit)ResourceCleanupcondition progresses throughCleanupStarted→CleanupAwaitingCompletion→CleanupCompletetask test:end-to-end) — newproject-deletiontest passes in 20.7s🤖 Generated with Claude Code