Skip to content

[action] [PR:844] [BMC] Fix bmcctld startup race and honor admin_status on air-cooled boot#72

Merged
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/844
Jul 2, 2026
Merged

[action] [PR:844] [BMC] Fix bmcctld startup race and honor admin_status on air-cooled boot#72
mssonicbld merged 1 commit into
Azure:202608from
mssonicbld:cherry/msft-202608/844

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

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

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>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-platform-daemons#844

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@mssonicbld mssonicbld merged commit cf61cde into Azure:202608 Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant