Skip to content

fix: remove blocking waits during deletion - #653

Open
vprashar2929 wants to merge 1 commit into
sustainable-computing-io:mainfrom
vprashar2929:chore-deleter
Open

fix: remove blocking waits during deletion#653
vprashar2929 wants to merge 1 commit into
sustainable-computing-io:mainfrom
vprashar2929:chore-deleter

Conversation

@vprashar2929

Copy link
Copy Markdown
Collaborator

Replace blocking wait.PollUntilContextTimeout with non-blocking check-and-requeuepattern in Deleter reconciler. This reduces PowerMonitor CR deletion time from5+ minutes to under 30 seconds by allowing Kubernetes GC to run in parallelinstead of sequentially polling for each resource deletion.

Changes:

  • Refactor Deleter to use check-and-requeue instead of blocking polls
  • Remove WaitTimeout field from Deleter (no longer needed)
  • Update Deleter tests for non-blocking behavior
  • Remove 2-minute namespace deletion wait in PowerMonitorInternal cleanup

@github-actions github-actions Bot added the fix A bug fix label Dec 22, 2025
@codecov

codecov Bot commented Dec 22, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.60%. Comparing base (329e01d) to head (0a10f78).
⚠️ Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
+ Coverage   78.89%   79.60%   +0.71%     
==========================================
  Files          11       11              
  Lines        1085     1074      -11     
==========================================
- Hits          856      855       -1     
+ Misses        199      191       -8     
+ Partials       30       28       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vprashar2929
vprashar2929 marked this pull request as ready for review January 27, 2026 10:57
@vprashar2929

Copy link
Copy Markdown
Collaborator Author

codecov can be ignored since it is for error paths

@vimalk78

vimalk78 commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

doesn't having blocking behavior guarantees operation ordering. with non-blocking need to manage state more carefully

@vprashar2929

Copy link
Copy Markdown
Collaborator Author

doesn't having blocking behavior guarantees operation ordering. with non-blocking need to manage state more carefully

The ordering is safe because all resources that are suppose to delete during cleanup have owner references. Even if the Finalizer proiceeds before deletion GC handles and deletes any remaining dependents so no resources are left behind

@vprashar2929
vprashar2929 force-pushed the chore-deleter branch 3 times, most recently from ca9875a to fbafe74 Compare February 16, 2026 08:07
@vimalk78

Copy link
Copy Markdown
Collaborator

please do a Claude Code review of this PR. this needs more changes

@vprashar2929

Copy link
Copy Markdown
Collaborator Author

Can you share your review analysis?

@vprashar2929

Copy link
Copy Markdown
Collaborator Author

Specifically changes that are required

Replace blocking wait.PollUntilContextTimeout with
non-blocking check-and-requeuepattern in Deleter reconciler.
This reduces PowerMonitor CR deletion time from5+ minutes to
under 30 seconds by allowing Kubernetes GC to run in
parallelinstead of sequentially polling for each resource deletion.

Changes:
- Refactor Deleter to issue non blocking deletes and return Continue
- Remove WaitTimeout field from Deleter
- Update Deleter tests for non blocking deletes
- Remove 2 minute namespace deletion wait in PMI cleanup

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
@vprashar2929

Copy link
Copy Markdown
Collaborator Author

@vimalk78 Can you re-review it? Thanks 🙏

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

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants