← Back to Pull requests

Support Configurable Max Exponential Backoff Delay for Direct Controllers #13653

Closed
unknown closed this pull request without merging on Oct 07, 2026 19:11 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 08:19 UTC
Author

Summary

Support configurable maximum exponential backoff delay ceiling and complete automated retry halting for direct controllers via the resource annotation:
cnrm.cloud.google.com/backoff-max-delay-in-seconds

Details & Behavior

1. Annotation: cnrm.cloud.google.com/backoff-max-delay-in-seconds
- Unset / empty: Retains default exponential retry behavior capped by controller-runtime workqueue limiter (120s ceiling).
- Positive integer (e.g. "600"): Calculates per-resource exponential backoff (baseDelay 2^(failures-1) capped at the specified max delay) and returns reconcile.Result{RequeueAfter: nextDelay}, nil.
- Special value "0": Halts automated error retries by recording Ready=False condition and returning reconcile.Result{}, nil. No periodic drift re-enqueue is scheduled until .spec is modified, metadata/annotations change, or the controller pod restarts.
- Malformed / negative value: Logs parse error and falls back to default error retry behavior.
2. Lifecycle Guarantees:
- Deletion intent precedence: Resources with deletionTimestamp != nil bypass custom backoff and retry halting, returning errors directly to controller-runtime for prompt deletion retries.
- Reset on success: On successful reconciliation, failure counts are cleared (Forget(request.NamespacedName)).
- Immediate wake-up on .spec edit: Generation changes trigger immediate reconciliation through controller-runtime watch predicates.
3. Tests:
- Unit tests for parser and exponential backoff limiter in pkg/controller/ratelimiter/dynamicratelimiter_test.go.
- Unit tests in pkg/controller/direct/directbase/directbase_controller_test.go verifying "0" retry halt, positive max delay capping, malformed input fallback, success resets, and deletion bypass.
- E2E scenario test in tests/e2e/testdata/scenarios/backoff_max_delay_zero/ verifying retry halt on failure and immediate recovery upon .spec update.

Fixes #13649

``release-note
Support configurable max exponential backoff delay ceiling and retry halting for direct controllers via
cnrm.cloud.google.com/backoff-max-delay-in-seconds annotation.
``


This PR was generated by the
overseer** agent (powered by the gemini-3.7-flash model).

Diff: 286 lines (+214 / -72) across 3 files Reviewer: sdowell Review duration: 7852m
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 286 lines diff across 3 files
0.63
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.339
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #13653"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 63.0% (MEDIUM) · Higher = larger blast radius
63.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24.9% · Safe to merge
24.9%