8000 Fix for 22138: Chassisd does not wait for the execution to complete for previous admin state change requests - Replaces PR: #3845 by rameshraghupathy · Pull Request #3937 · sonic-net/sonic-utilities · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix for 22138: Chassisd does not wait for the execution to complete for previous admin state change requests - Replaces PR: #3845 #3937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 27, 2025

Conversation

rameshraghupathy
Copy link
Contributor
@rameshraghupathy rameshraghupathy commented Jun 25, 2025

Fixed issue #22138
Replaces PR: #3845 which was closed accidentally
The corresponding sonic-platform-daemon PR is : sonic-net/sonic-platform-daemons#607

What I did
Fixed issue #22138
Chassisd does not wait for the execution to complete for previous admin state change requests. Added support to solve this.

How I did it
Added a state to indicate the progress of an admin_state transition period (window) of every module in config_db.
When in progress do not allow another admin_state change for that module.
Mark the beginning of state transition in the CLI itself. Added a timeout also for error cases.
Mark the end of state transition in chassisd.

How to verify it
Issue "config chassis module startup DPU0". This takes around 3 mins. Check the config_db and verify the new variable is set to True.
Issue another "config chassis module startup DPU0" and also ""config chassis module shutdown DPU0".
See both are blocked.
Once the DPU operational state is the admin_sate check if a new config is accepted.

Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)

Request for 202505

  • 202505

@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@rameshraghupathy rameshraghupathy changed the title Fix for 22430: Chassisd does not wait for the execution to complete for previous admin state change requests - Replaces PR: #3845 Fix for 22138: Chassisd does not wait for the execution to complete for previous admin state change requests - Replaces PR: #3845 Jun 25, 2025
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds state transition tracking for chassis module admin state changes, ensuring no overlapping operations and timing out stale transitions.

  • Introduces StateDBHelper and helper functions for tracking transition state in STATE_DB
  • Extends shutdown_chassis_module and startup_chassis_module to guard against concurrent transitions and handle timeouts
  • Adds comprehensive tests for transition tracking and timeout logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
config/chassis_modules.py Added state-tracking helpers, ensure_statedb_connected, and updated startup/shutdown commands to include transition checks and timeouts
tests/chassis_modules_test.py New tests covering transition tracking, timeout behavior, and helper functions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@vvolam
Copy link
Contributor
vvolam commented Jun 26, 2025

@rameshraghupathy could you please comment "/azpw run" to re-run the pipeline??

@rameshraghupathy
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #3940

rlhui pushed a commit to sonic-net/sonic-platform-daemons that referenced this pull request Jun 30, 2025
…in state change requests. Fixed issue #22138 (#607)

Fixed issue #22138
Chassisd does not wait for the execution to complete for previous admin state change requests. Added support to solve this.

The corresponding sonic-utilities PR is: sonic-net/sonic-utilities#3937

Motivation and Context
Added a state to indicate the progress of an admin_state transition period (window) of every module in config_db.
When in progress do not allow another admin_state change for that module.
Mark the beginning of state transition in the CLI itself. Added a timeout also for error cases.
Mark the end of state transition in chassisd
mssonicbld added a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Jul 1, 2025
…in state change requests. Fixed issue #22138

Chassisd does not wait for the execution to complete for previous admin state change requests. Fixed issue #22138

#### Description
Fixed issue #22138
Chassisd does not wait for the execution to complete for previous admin state change requests. Added support to solve this.

The corresponding sonic-utilities PR is: sonic-net/sonic-utilities#3937

#### Motivation and Context
Added a state to indicate the progress of an admin_state transition period (window) of every module in config_db.
When in progress do not allow another admin_state change for that module.
Mark the beginning of state transition in the CLI itself. Added a timeout also for error cases.
Mark the end of state transition in chassisd

#### How Has This Been Tested?
ssue "config chassis module startup DPU0". This takes around 3 mins. Check the config_db and verify the new variable is set to True.
Issue another "config chassis module startup DPU0" and also ""config chassis module shutdown DPU0".
See both are blocked.
Once the DPU operational state is the admin_sate check if a new config is accepted.

#### Request for 202505
- [x] 202505

#### Additional Information (Optional)
Goes with PR: sonic-net/sonic-utilities#3845
mssonicbld added a commit to sonic-net/sonic-platform-daemons that referenced this pull request Jul 1, 2025
…in state change requests. Fixed issue #22138 (#637)

Chassisd does not wait for the execution to complete for previous admin state change requests. Fixed issue #22138

#### Description
Fixed issue #22138
Chassisd does not wait for the execution to complete for previous admin state change requests. Added support to solve this.

The corresponding sonic-utilities PR is: sonic-net/sonic-utilities#3937

#### Motivation and Context
Added a state to indicate the progress of an admin_state transition period (window) of every module in config_db.
When in progress do not allow another admin_state change for that module.
Mark the beginning of state transition in the CLI itself. Added a timeout also for error cases.
Mark the end of state transition in chassisd

#### How Has This Been Tested?
ssue "config chassis module startup DPU0". This takes around 3 mins. Check the config_db and verify the new variable is set to True.
Issue another "config chassis module startup DPU0" and also ""config chassis module shutdown DPU0".
See both are blocked.
Once the DPU operational state is the admin_sate check if a new config is accepted.

#### Request for 202505
- [x] 202505

#### Additional Information (Optional)
Goes with PR: sonic-net/sonic-utilities#3845
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.

5 participants
0