[action] [PR:844] [BMC] Fix bmcctld startup race and honor admin_status on air-cooled boot#72
Merged
Conversation
Fix bmcctld startup race and honor admin_status on air-cooled boot #### Description 1) sync HOST_STATE and seed CHASSIS_MODULE admin_status dedup before starting the BmcEventHandler thread; add BmcEventHandler.seed_chassis_module_admin_status() so CONFIG SubscriberStateTable replays are treated as already handled. 2) For non-liquid-cooled platforms, gate automatic startup power_on on CONFIG admin_status=up and skip power_on if admin_status=down. Update run() docstring and add unit tests for seed/dedup, startup ordering and admin-down skip paths. #### Motivation and Context 1) bmcctld start can enqueue ACTION_POWER_ON from CONFIG replay before HOST_STATE init and action-loop readiness; CLI changes are logged as "initiating ..." but may never reach "Executing action ...". With a single action-loop consumer, an early or stuck power_on blocks subsequent CLI-driven actions until bmcctld restart. 2) Also fix air-cooled boot ignoring if CONFIG_DB has admin_status=down. #### How Has This Been Tested? run() order is init_host_state() -> seed_chassis_module_admin_status() -> event thread -> boot sequence -> action loop. Dedup seed records the current CONFIG admin_status so replay does not enqueue ACTION_POWER_ON. Non-liquid OFFLINE boot checks get_switch_host_admin_status() and skips power_on unless admin is up. #### Additional Information (Optional) New unit tests cover CONFIG replay dedup after seed, HOST_STATE init before event thread, non-liquid skip when admin_status=down, and non-liquid power_on when admin_status=up. Nokia H6-128 BMC verified: first-install CLI shutdown/startup works without pmon restart; BMC reboot with admin down leaves Switch-Host powered off. Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-platform-daemons#844 |
Collaborator
Author
|
/azp run |
|
No pipelines are associated with this pull request. |
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.
Fix bmcctld startup race and honor admin_status on air-cooled boot
Description
add BmcEventHandler.seed_chassis_module_admin_status() so CONFIG SubscriberStateTable replays are treated as already handled.
Motivation and Context
How Has This Been Tested?
run() order is init_host_state() -> seed_chassis_module_admin_status() ->
event thread -> boot sequence -> action loop. Dedup seed records the current CONFIG admin_status so replay does not enqueue ACTION_POWER_ON. Non-liquid OFFLINE boot checks get_switch_host_admin_status() and skips power_on unless admin is up.
Additional Information (Optional)
New unit tests cover CONFIG replay dedup after seed, HOST_STATE init before event thread, non-liquid skip when admin_status=down, and non-liquid power_on when admin_status=up. Nokia H6-128 BMC verified: first-install CLI shutdown/startup works without pmon restart; BMC reboot with admin down leaves Switch-Host powered off.
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com