-
Notifications
You must be signed in to change notification settings - Fork 165
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
chassisd: Fix crash on exit on linecard #347
chassisd: Fix crash on exit on linecard #347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patrickmacarthur thanks for the fix, can you please add a UT to cover this? PR is blocked by coverage check
@gechiang for viz. |
@patrickmacarthur can you also include a test to cover the one line change you fixed? This is required before the change can be merged. |
We try to access config_manager, even if it wasn't set. Unconditionally set it to resolve the issue.
f09fd52
to
a62426e
Compare
/azpw run Azure.sonic-platform-daemons |
/AzurePipelines run Azure.sonic-platform-daemons |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We try to access config_manager, even if it wasn't set. Unconditionally set it to resolve the issue.
@patrickmacarthur cherry pick to 202211 with conflict, could you submit PR separately for 202211? |
Description
Set the
config_manager
variable toNone
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 theconfig_manager
variable is only ever initialized if we are on the supervisor. Thus, checking if it isNone
is insufficient because this results in anUnboundLocalError
that prevents the cleanup from succeeding on a linecard.How Has This Been Tested?
This was tested via the sonic-mgmt
platform_tests/daemon/test_chassisd.py
test. Without this change, thetest_pmon_chassisd_stop_and_start_status
test would fail and a traceback would be present in syslog. The test passes with this patch applied.Additional Information (Optional)