fix(machine-controller): report DPU restart outcome accurately#3904
Conversation
Signed-off-by: Behrooz Rafii <brafii@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughThe DPU restart handler now performs the Redfish restart before recording reboot-request state or logging success. Restart errors propagate directly, preventing database updates and success logs when the operation fails. ChangesDPU restart sequencing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| machine_id: machine.id, | ||
| mode: model::machine::MachineLastRebootRequestedMode::Reboot, | ||
| time: Utc::now(), | ||
| }); |
There was a problem hiding this comment.
pending_db_writes is suppose to be discarded when restart_dpu fails (the result from restart_dpu is the result for this function).
I feel like there's a bigger problem that is not fixed by this change.
There was a problem hiding this comment.
so my issue isn't with the code apparently. the description says:
Records the reboot-request timestamp and logs success only after the restart succeeds.
which the timestamp update doesn't happen. that's what the pending_db_writes vector is for
There was a problem hiding this comment.
as I think about it more, the timestamp update should be done unconditionally if the restart works, right? if something else fails, do we not want the timestamp update?
DPU restart handling logged success and queued the reboot-request timestamp before the Redfish restart completed. When the restart failed, logs could falsely imply success, and the lower-level failure log did not identify the affected DPU.
This change:
dpu_machine_idand the returned error.This gives operators an accurate restart outcome and identifies the failed DPU without changing any API or configuration.
Related issues
Fixes #3713
Type of Change
Breaking Changes
Testing
cargo test -p carbide-machine-controller --libcargo fmt --all -- --checkAdditional Notes
No API, configuration, or database-schema changes.