[smartswitch]: Use reboot_gracefully() to record DPU reboot time at command invocation#4571
Open
vvolam wants to merge 2 commits into
Open
[smartswitch]: Use reboot_gracefully() to record DPU reboot time at command invocation#4571vvolam wants to merge 2 commits into
vvolam wants to merge 2 commits into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates module reboot handling so DPU reboot time can be recorded at command invocation when the platform exposes the newer graceful reboot API, while preserving compatibility with older platform implementations.
Changes:
- Caches the resolved platform module object before reboot handling.
- Prefers
reboot_gracefully(reboot_type)when available. - Falls back to the existing
reboot(reboot_type)path otherwise.
…d invocation Signed-off-by: Vasundhara Volam <vvolam@microsoft.com>
ae89dc1 to
410a25f
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The new reboot_gracefully tests modify module_helper.platform_chassis which persisted to subsequent tests (test_module_pre_shutdown_success, test_module_post_startup_success) causing them to fail. Fix by adding an autouse fixture that saves and restores module_helper.platform_chassis between tests. Signed-off-by: Vasundhara Volam <vvolam@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Updated
ModuleHelper.reboot_module()to callreboot_gracefully()(when available) instead ofreboot()directly. This ensuresprev_reboot_time.txtis written at the moment the user issuesreboot -d DPUx, before any race withconfig reloador chassisd restart.Fixes: sonic-net/sonic-buildimage#24275
How I did it
In
utilities_common/module.py, thereboot_module()method now:reboot_gracefully()(introduced in [smartswitch] Record DPU reboot time at command invocation sonic-platform-common#680).reboot_gracefully(reboot_type)which records the reboot timestamp then delegates toreboot().reboot(reboot_type)for platforms that have not yet picked up the new method.How to verify it
/host/reboot-cause/module/DPU0/prev_reboot_time.txtis created immediately.config reloadright after — the reboot time file should persist and not be lost.reboot_gracefully(), verifyreboot -d DPU0still works via the fallback path.Previous command output (if the output of a command-line utility has changed)
N/A — no CLI output changes.
New command output (if the output of a command-line utility has changed)
N/A — no CLI output changes.
Related PRs:
reboot_gracefully()and_record_dpu_reboot_time()toModuleBase