Skip to content

[code sync] Merge code from sonic-net/sonic-platform-common:202605 to 202607 - #123

Merged
mssonicbld merged 2 commits into
Azure:202607from
mssonicbld:sonicbld/202607-merge
Jul 25, 2026
Merged

[code sync] Merge code from sonic-net/sonic-platform-common:202605 to 202607#123
mssonicbld merged 2 commits into
Azure:202607from
mssonicbld:sonicbld/202607-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* 58def69 - (origin/202605) [module_base]: Add 'recovery' transition type to _TRANSITION_TIMEOUT_DEFAULTS (#726) (2026-07-25) [mssonicbld]<br>```

mssonicbld and others added 2 commits July 25, 2026 03:13
…DEFAULTS (#726)

#### Description

Add a `"recovery": 600` (10 min) entry to `ModuleBase._TRANSITION_TIMEOUT_DEFAULTS`.

`set_module_state_transition()` validates the requested `transition_type` against the keys of `_TRANSITION_TIMEOUT_DEFAULTS`. chassisd's DPU power-cycle auto-recovery acquires the module state-transition lock via `set_module_state_transition(name, 'recovery')`; because `'recovery'` was missing from the defaults, every recovery acquisition was rejected ("Cannot acquire state transition lock") and the power-cycle was silently skipped — blocking DPU auto-recovery.

#### Motivation and Context

The `'recovery'` transition type is used by chassisd (sonic-platform-daemons) to power-cycle an unresponsive DPU. Without a matching entry in `_TRANSITION_TIMEOUT_DEFAULTS`, the transition is never accepted, so a DPU that loses its control plane is never power-cycled. This unblocks the DPU auto-recovery path in sonic-net/sonic-platform-daemons#829.

`recovery` has no `platform.json` override (only `startup`/`shutdown`/`reboot`/`halt_services` are overridable in `_load_transition_timeouts()`), so the 600 s default applies uniformly. The timeout only bounds the power-cycle critical section (pre_shutdown → admin down → admin up → post_startup), which is cleared in `finally`; 600 s is ample headroom.

#### How Has This Been Tested?

- Unit tests: updated the timeout-loading tests in `tests/module_base_test.py` to expect the new key. `python3 -m pytest tests/module_base_test.py` → **115 passed**.
- On-device with both master and 202605 image: with the fix, a control-plane-down DPU was power-cycled (reboot-cause "Switch rebooted DPU") and recovered to `ready_status=true`.

#### Additional Information (Optional)

Companion to sonic-net/sonic-platform-daemons#829 (chassisd DPU auto-recovery robustness), which issues the `'recovery'` transition this default enables.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld
mssonicbld merged commit e0644e0 into Azure:202607 Jul 25, 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