-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Chassis][multiasic] Fix the sonic-db-cli core files issue on multiasic platform after the c++ implementation of sonic-db-cli #13207
Conversation
@rlhui @judyjoseph @abdosi After 202205 branch uses the c++ implementation of the sonic-db-cli, even with PR sonic-net/sonic-swss-common#701, database.sh still generates many core files. This PR will address this core files issue. Please review it. |
# sonic-db-cli try to initialize the global database. If in multiasic platform, inital global | ||
# database will try to access to all other instance database-config.json. If other instance | ||
# database-config.json files are not ready yet, it will generate the sonic-db-cli core files. | ||
waitForAllInstanceDatabaseConfigJsonFilesReady |
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.
The crash is not cause by a behavior change, python version sonic-db-cli also crash in this case, access name space DB need name space config file ready.
/azp run |
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. |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
871c6ef
to
a47d0ec
Compare
…ic platform after the c++ implementation of sonic-db-cli Signed-off-by: mlok <marty.lok@nokia.com>
a47d0ec
to
9f36c25
Compare
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
This PR needs to be marked "request for 202205" |
@mlok-nokia @judyjoseph Please add request for 202211 |
…ic platform after the c++ implementation of sonic-db-cli (sonic-net#13207) Fixe sonic-net#12047. After the c++ implementation of the sonic-db-cli, sonic-db-cli PING command tries to initialize the global database for all instances database starting. If all instance database-config.json are not ready yet. it will crash and generate core file. PR sonic-net/sonic-swss-common#701 only fix the crash and the process abortion. Signed-off-by: mlok <marty.lok@nokia.com>
Cherry-pick PR to 202205: #14108 |
…ic platform after the c++ implementation of sonic-db-cli (#13207) Fixe #12047. After the c++ implementation of the sonic-db-cli, sonic-db-cli PING command tries to initialize the global database for all instances database starting. If all instance database-config.json are not ready yet. it will crash and generate core file. PR sonic-net/sonic-swss-common#701 only fix the crash and the process abortion. Signed-off-by: mlok <marty.lok@nokia.com>
Why I did it
Fixe #12047. After the c++ implementation of the sonic-db-cli, sonic-db-cli PING command tries to initialize the global database for all instances database starting. If all instance database-config.json are not ready yet. it will crash and generate core file. PR sonic-net/sonic-swss-common#701 only fix the crash and the process abortion. With this PR, many core files are still generated:
The following error are logged in the syslog
The following core files are generated
How I did it
In the database.sh, call function waitForAllInstanceDatabaseConfigJsonFilesReady to make sure all instance database-config.json are present before the command sonic-db-cli PING. This will avoid the database-config,json doesn't exist and cause errors and generate the core file.
How to verify it
With this change, after the image install and boot up, check and verify the syslog, the following lines should not be in the syslog and this related core file should not be seen.
'''
Dec 28 16:44:34.811893 ixre-cpm-chassis8 ERR sonic-db-cli: :- parseDatabaseConfig: Sonic database config file doesn't exist at /var/run/redis/sonic-db/../../redis0/sonic-db/database_config.json
Dec 28 16:44:34.812099 ixre-cpm-chassis8 ERR sonic-db-cli: :- initializeGlobalConfig: Sonic database config file syntax error >> Sonic database config file doesn't exist at /var/run/redis/sonic-db/../../redis0/sonic-db/database_config.json
Dec 28 16:44:34.812162 ixre-cpm-chassis8 INFO database.sh[5764]: terminate called after throwing an instance of 'std::runtime_error'
Dec 28 16:44:34.812215 ixre-cpm-chassis8 INFO database.sh[5764]: what(): Sonic database config file syntax error >> Sonic database config file doesn't exist at /var/run/redis/sonic-db/../../redis0/sonic-db/database_config.json
'''
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)