-
Notifications
You must be signed in to change notification settings - Fork 47
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
Handle exception to avoid lldp_syncd crash #65
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
bingwang-ms
approved these changes
May 21, 2024
LGTM. Thanks for the fix! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
ZhaohuiS
added
Request for 202305 Branch
and removed
Cherry Pick Conflict_202311
labels
May 23, 2024
hi @yxieca need cherry pick for 202311. |
hi @ZhaohuiS could you update the ADO in this PR? And also the test result with 202305 and 202311? |
mssonicbld
pushed a commit
to mssonicbld/sonic-dbsyncd
that referenced
this pull request
Aug 2, 2024
* Handle exception smooth to avoid lldp_syncd crash Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Cherry-pick PR to 202311: #69 |
mssonicbld
pushed a commit
that referenced
this pull request
Aug 2, 2024
* Handle exception smooth to avoid lldp_syncd crash Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
mssonicbld
added
Included in 202311 Branch
and removed
Created PR to 202311 Branch
labels
Aug 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue description
When there is invalid string in chassis name or other fields, json.load could throw exception and return None in function _scrap_output, it could cause TypeError: 'NoneType' object does not support item assignment when running the following code:
lldp_json['lldp_loc_chassis'] = self._scrap_output(cmd_local
Traceback looks like below and cause lldp_syncd crash:
How to fix
Handle None returned value in
source_update
and return None if can't parse the lldpctl json output.This can avoid lldp_syncd crash.
The expected syslog for invalid output in lldpctl command:
May 21 07:11:35.135275 hostname WARNING lldp#lldp-syncd [sonic_syncd] WARNING: No source information returned during last update. Skipping sync.
workitem
28004915