Skip to content

THREESCALE-14654 Fix status reconciler requeue logic#1177

Open
urbanikb wants to merge 1 commit into3scale:masterfrom
urbanikb:THREESCALE-14654
Open

THREESCALE-14654 Fix status reconciler requeue logic#1177
urbanikb wants to merge 1 commit into3scale:masterfrom
urbanikb:THREESCALE-14654

Conversation

@urbanikb
Copy link
Copy Markdown
Contributor

@urbanikb urbanikb commented May 7, 2026

Fixes https://issues.redhat.com/browse/THREESCALE-14654

Summary

  • Fixes equalStatus && newAvailable guard: the unavailable-but-equal case fell through to a no-op status write on every reconcile. Changed to if equalStatus which short-circuits both available and unavailable steady states.
  • Switches both unavailable return paths from Requeue: true (immediate tight-loop) to RequeueAfter: 30s, giving components time to recover between checks and avoiding extending the backoff counter.

Test plan

  • Unit tests: go test ./controllers/apps/... -run TestAPIManagerStatusReconciler
  • TestAPIManagerStatusReconciler_Reconcile_requeueAfterWhenUnavailable verifies RequeueAfter is non-zero on True→False transition

🤖 Generated with Claude Code

@urbanikb urbanikb requested a review from a team as a code owner May 7, 2026 20:26
@urbanikb urbanikb changed the title THREESCALE-14654 Fix status reconciler requeue logic THREESCALE-14224 (THREESCALE-14654) Fix status reconciler requeue logic May 7, 2026
@tkan145
Copy link
Copy Markdown
Contributor

tkan145 commented May 8, 2026

/retest

@urbanikb urbanikb changed the title THREESCALE-14224 (THREESCALE-14654) Fix status reconciler requeue logic THREESCALE-14654 Fix status reconciler requeue logic May 8, 2026
…us write

Two issues in the previous requeue logic:

1. The guard `equalStatus && newAvailable` caused the unavailable-but-equal
   case to fall through to a status write even when nothing had changed,
   producing a no-op write on every reconcile while the instance remained
   unavailable. The new `if equalStatus` guard short-circuits both the
   available and unavailable steady states, avoiding the unnecessary write.

2. Both unavailable return paths used `Requeue: true` (immediate requeue),
   which causes tight-loop reconciliation against an instance that is still
   unavailable. Switching to `RequeueAfter: 30s` gives components time to
   recover between checks and avoids extending backoff counter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@urbanikb urbanikb force-pushed the THREESCALE-14654 branch from 5c2e21f to 5086f39 Compare May 8, 2026 05:15
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.98%. Comparing base (4963add) to head (5086f39).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
controllers/apps/apimanager_status_reconciler.go 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1177      +/-   ##
==========================================
+ Coverage   41.84%   43.98%   +2.13%     
==========================================
  Files         203      204       +1     
  Lines       20859    20927      +68     
==========================================
+ Hits         8729     9205     +476     
+ Misses      11350    10920     -430     
- Partials      780      802      +22     
Flag Coverage Δ
unit 43.98% <25.00%> (+2.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
apis/apps/v1alpha1 (u) 63.19% <ø> (+4.64%) ⬆️
apis/capabilities/v1alpha1 (u) 3.50% <ø> (ø)
apis/capabilities/v1beta1 (u) 20.21% <ø> (ø)
controllers (i) 12.08% <86.36%> (+2.76%) ⬆️
pkg (u) 63.69% <81.73%> (+1.97%) ⬆️
Files with missing lines Coverage Δ
controllers/apps/apimanager_status_reconciler.go 73.43% <25.00%> (+73.43%) ⬆️

... and 9 files with indirect coverage changes

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

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.

3 participants