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

[portconfig]: Remove try exception during config_db initialization. #10960

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

SuvarnaMeenakshi
Copy link
Contributor

loading database config already handles exception so this is not
required in portconfig. Move laoding database config to application
code instead of portconfig as portconfig is used as a library.

Signed-off-by: Suvarna Meenakshi sumeenak@microsoft.com

Why I did it

Provide fix for comment: https://github.com/Azure/sonic-buildimage/pull/10475/files#r847753187;
Move laoding database config to application code instead of portconfig as portconfig is used as a library.
#10581 was raised for this fix, but had to be reverted due to issue with multi-asic platform.

How I did it

Remove try exception handing from portconfig.py during config_db intialization.
Move loading of database config to application that uses portconfig.py.

How to verify it

unit-test passes.
Verified that it does not cause issue during boot up of multi-asic VS image.
Verified that config_db generation was successful in multi-asic VS.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

loading database config already handles exception so this is not
required in portconfig. Move laoding database config to application
code instead of portconfig as portconfig is used as a library.

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@SuvarnaMeenakshi
Copy link
Contributor Author

Observing "vlab-08 ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized" in multi-asic VS during boot up. Does not cause any issue, but have to check the reason for this error message.

@SuvarnaMeenakshi
Copy link
Contributor Author

initializeGlobalConfig

This error message is seen on an image without this change as well. Checked on 4-asic VS testbed "master.101959-392899682" image. Still shows the same error:
Jun 1 20:58:36.426814 vlab-08 ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized

@SuvarnaMeenakshi
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@SuvarnaMeenakshi SuvarnaMeenakshi requested a review from a team as a code owner June 8, 2022 21:19
@SuvarnaMeenakshi
Copy link
Contributor Author

initializeGlobalConfig

This error message is seen on an image without this change as well. Checked on 4-asic VS testbed "master.101959-392899682" image. Still shows the same error: Jun 1 20:58:36.426814 vlab-08 ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized

Confirmed that this error message is seen on image without this change on multi-asic VS.
ERR python3: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized and - not sure which script is throwing this error message.
ERR caclmgrd[19224]: :- initializeGlobalConfig: SonicDBConfig Global config is already initialized

@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 77ad3ff into sonic-net:master Jun 9, 2022
@qiluo-msft
Copy link
Collaborator

Need backport to other branches?

abdosi added a commit to sonic-net/sonic-utilities that referenced this pull request Mar 20, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 20, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
mssonicbld pushed a commit to sonic-net/sonic-utilities that referenced this pull request Mar 20, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 21, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
mssonicbld pushed a commit to sonic-net/sonic-utilities that referenced this pull request Mar 21, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
arfeigin pushed a commit to arfeigin/sonic-utilities that referenced this pull request Apr 2, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
rlhui pushed a commit that referenced this pull request Apr 17, 2024
…cDBConfig Global config is already initialized (#18609)

* [portconfig]: Remove try exception during config_db initialization. (#10960)

Why I did it
Provide fix for comment: https://github.com/Azure/sonic-buildimage/pull/10475/files#r847753187;
Move laoding database config to application code instead of portconfig as portconfig is used as a library.

How I did it
Remove try exception handing from portconfig.py during config_db intialization.
Move loading of database config to application that uses portconfig.py.

How to verify it
unit-test passes.
Verified that it does not cause issue during boot up of multi-asic VS image.
Verified that config_db generation was successful in multi-asic VS.

* Fix code base on the review

---------

Co-authored-by: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com>
@gechiang
Copy link
Collaborator

Please note that "#18609" was created for 202205 for this fix which included two additional changes not included in this PR. I have requested @deepak-singhal0408 to raise another PR to inlcude those two additional changes in the master branch as well to ensure that the fix is also complete in master.

wumiaont pushed a commit to wumiaont/sonic-utilities that referenced this pull request Apr 22, 2024
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
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