Skip to content
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

[202211] chassisd: Fix crash on exit on linecard #352

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

patrickmacarthur
Copy link
Contributor

Description

Set the config_manager variable to None if we are running on a
linecard and thus don't need to set up the config manager.

Motivation and Context

During cleanup, the chassid service tries to clean up the
config_manager, but the config_manager variable is only ever
initialized if we are on the supervisor. Thus, checking if it is
None is insufficient because this results in an UnboundLocalError
that prevents the cleanup from succeeding on a linecard.

How Has This Been Tested?

This has been tested via both the sonic-mgmt platform_tests test case
for the chassid daemon as well as the updated unit tests in this PR.

Additional Information

This is a cherry-pick of PR #347 to 202211 release branch. Note that
PR #328 is also backported to 202211 in this PR as it is required for the
unit test update to pass.

@patrickmacarthur patrickmacarthur changed the base branch from master to 202211 April 20, 2023 20:08
@prgeor
Copy link
Collaborator

prgeor commented May 5, 2023

@StormLiangMS to merge for 202211

@patrickmacarthur patrickmacarthur changed the title chassisd: Fix crash on exit on linecard [202211] chassisd: Fix crash on exit on linecard Jul 12, 2023
judyjoseph and others added 2 commits July 12, 2023 13:07
* Fix to explicit stop the config_manager
* Add tests for chassisd run method.
Set the `config_manager` variable to `None` if we are running on a
linecard and thus don't need to set up the config manager.

During cleanup, the chassid service tries to clean up the
`config_manager`, but the `config_manager` variable is only ever
initialized if we are on the supervisor. Thus, checking if it is
`None` is insufficient because this results in an `UnboundLocalError`
that prevents the cleanup from succeeding on a linecard.
@patrickmacarthur
Copy link
Contributor Author

/azpw run Azure.sonic-platform-daemons

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-platform-daemons

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kenneth-arista
Copy link

@arlakshm Test failure is due to a pipeline infra problem. Specifically,

No space left on device : '/home/vsts/work/1/target/b3eeaa0d-789f-4325-9cb3-90f2d8fab6d3.tmp'

@gechiang gechiang merged commit ea8e5c7 into sonic-net:202211 Jul 19, 2023
1 of 2 checks passed
@patrickmacarthur patrickmacarthur deleted the 202211-fix-chassisd-crash branch August 2, 2023 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants