Set ActiveDeadlineSeconds and BackoffLimit on device-init Job#75
Conversation
The device-init Job had no deadline or backoff limit, causing pods to hang indefinitely when storage is unavailable (e.g. Ceph degraded after node reboot). Set ActiveDeadlineSeconds=300s and BackoffLimit=1 to match the cleanup Job pattern. Emit a warning event on failure to aid diagnosis. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: razo7 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe controller configures SBR device-init Jobs with explicit deadlines and retry limits, detects failed Jobs through conditions, emits warning events, deletes failed Jobs, and allows recreation during subsequent reconciliation. Tests cover Job settings and failure-event behavior. ChangesSBR device initialization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Reconciler
participant KubernetesAPI
participant EventRecorder
Reconciler->>KubernetesAPI: Read device-init Job status
KubernetesAPI-->>Reconciler: Return JobFailed condition
Reconciler->>EventRecorder: Emit SBRDeviceInitFailed warning
Reconciler->>KubernetesAPI: Delete failed Job
Reconciler->>KubernetesAPI: Recreate Job on next reconcile
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/controller/storagebasedremediationconfig_controller.go`:
- Around line 910-925: In the failed-job handling loop around
existingJob.Status.Conditions, first detect whether existingJob has a
DeletionTimestamp and skip the failure-processing path while deletion is in
progress. Preserve the existing logging, warning event, deletion, and return
behavior for failed Jobs that are not already terminating.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4eb08c5d-8da8-403c-b933-84682aa2beff
📒 Files selected for processing (2)
internal/controller/storagebasedremediationconfig_controller.gointernal/controller/storagebasedremediationconfig_controller_test.go
Prevents hot-looping, redundant Delete calls, and duplicate warning events when a deleted Job lingers in Terminating state (e.g. pods stuck on volume unmounts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Returning (None, nil) allowed the caller to fall through to DaemonSet creation while the failed Job was still terminating. Return an error so the caller requeues with backoff instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/test 5.0-openshift-e2e |
What does this PR do?
Sets
ActiveDeadlineSeconds(300s) andBackoffLimit(1) on the device-init Job, matching the cleanup Job pattern. Emits a warning event on failure to aid diagnosis.Why is this needed?
The device-init Job had no deadline or backoff limit, causing pods to hang indefinitely when storage is unavailable (e.g. Ceph degraded after node reboot).
This blocks agent deployment with no operator-level signal of the problem.
Related: RHWA-1370
How was this tested?
ActiveDeadlineSecondsandBackoffLimitare set on created Jobgo vetcleanChecklist
Summary by CodeRabbit
Bug Fixes
Reliability
Tests