Add bmpcfgd for monitoring config_db state change.#18940
Merged
qiluo-msft merged 21 commits intosonic-net:masterfrom Sep 19, 2024
Merged
Add bmpcfgd for monitoring config_db state change.#18940qiluo-msft merged 21 commits intosonic-net:masterfrom
qiluo-msft merged 21 commits intosonic-net:masterfrom
Conversation
qiluo-msft
reviewed
May 11, 2024
qiluo-msft
reviewed
May 11, 2024
qiluo-msft
reviewed
May 11, 2024
qiluo-msft
reviewed
May 11, 2024
Contributor
Author
|
/azp run Azure.sonic-buildimage |
|
Command 'Azure.sonic-buildimage' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
|
Commenter does not have sufficient privileges for PR 18940 in repo sonic-net/sonic-buildimage |
qiluo-msft
reviewed
May 24, 2024
| subprocess.call(["service", "openbmpd", "start"]) | ||
|
|
||
|
|
||
| class BMPCfgDaemon: |
Contributor
Contributor
Author
There was a problem hiding this comment.
This daemon should be running in each bmp container, each bmp container will have 1 bmpcfgd + 1 openbmpd.
qiluo-msft
reviewed
Sep 6, 2024
src/sonic-bmpcfgd/scripts/bmpcfgd
Outdated
| self.config_db.connect(wait_for_init=True, retry_on=True) | ||
| self.bmpcfg = BMPCfg(self.state_db_conn) | ||
| except KeyError as error: | ||
| self.log_error( |
Collaborator
Contributor
Author
There was a problem hiding this comment.
updated without try/catch.
qiluo-msft
reviewed
Sep 6, 2024
src/sonic-bmpcfgd/scripts/bmpcfgd
Outdated
|
|
||
| class BMPCfgDaemon: | ||
| def __init__(self): | ||
| try: |
Collaborator
Contributor
Author
There was a problem hiding this comment.
Rethink about this, we should not need try/catch in init flow, any exception should terminate and propagate the call stack, updated code.
qiluo-msft
approved these changes
Sep 19, 2024
This file contains hidden or 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
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.
Why I did it
sonic-net/SONiC#1621, need dedicated daemon to monitor config_db and manage openbmpd state.
Work item tracking
How I did it
Use swss-common lib to monitor config_db change.
How to verify it
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)