-
Notifications
You must be signed in to change notification settings - Fork 291
Remove the error log form SonicDBConfig::initializeGlobalConfig #869
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
Conversation
…it has already been done
@deepak-singhal0408 @mlok-nokia Please help to review. |
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..
MSFT ADO: 25516271 |
@deepak-singhal0408 Thanks for review. Can you help to merge the changes? I don't have permission to do that. Thanks. |
Hi @qiluo-msft, could you please help review this PR? Thanks! |
@@ -84,7 +84,6 @@ void SonicDBConfig::initializeGlobalConfig(const string &file) | |||
|
|||
if (m_global_init) | |||
{ | |||
SWSS_LOG_ERROR("SonicDBConfig Global config is already initialized"); |
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.
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.
Block this PR, adding comment.
Hi @wumiaont , please have a look at this PR.. sonic-net/sonic-buildimage#10960.. |
The issue does not happen on master. Have a fix for 202205. Please review that one. sonic-net/sonic-buildimage#18609 |
Issue: If run "show interfaces status" we often see the error in syslog "SonicDBConfig Global config is already initialized".
Analysis: During investigation it is found the swsscommon.load_sonic_global_db_config() has been triggered multiple times. Espically in a multi Asic scenario.
CLI triggers "intfutil -c status" with a separate process. Within the process it will trigger IntfStatus init --> MultiAsic() init-->load_db_config()-->load_sonic_global_db_config(). This time initializeGlobalConfig() will run to the end as m_global_init flag is false.
CLI will also run get_port_config() --> db_connect_configdb() --> load_sonic_global_db_config() (for different namepaces. In our case is asic0 and asic1). This time m_global_init flag is true which causes error log and return.
Conclusion: After researching we found load_db_config() could be called by different Classes. The code has already added protection to avoid to initialize global config multiple time. The error log is not necessary to be there.
Solution: Removed the error log from initializeGlobalConfig() when found global config is already initialized.