-
Notifications
You must be signed in to change notification settings - Fork 273
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
[sonic-db-cli] Fix sonic-db-cli crash when database config file not ready issue. #701
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
This was referenced Oct 24, 2022
qiluo-msft
approved these changes
Oct 24, 2022
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This PR (and all sonic-swss-common) PR blocked by validation break, which because change in sonic-net/sonic-sairedis#1116 |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
That PR has been reverted due to tests becoming potentially flaky. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
yxieca
pushed a commit
that referenced
this pull request
Nov 3, 2022
…eady issue. (#701) #### Why I did it Fix sonic-db-cli PING/SAVE/FLUSHALL command crash when database config file not ready issue: sonic-net/sonic-buildimage#12047 #### How I did it When run PING/SAVE/FLUSHALL command, catch database initialize failed exception and return 1. #### How to verify it Pass all existing UT and E2E test. Add new UT to cover changed code. Manually test, sonic-db-cli will return 1 when run PING command and can't find config file: azureuser@a7f66d2b794c:/sonic/src/sonic-swss-common$ ./sonic-db-cli/sonic-db-cli PING An exception of type Sonic database config file doesn't exist at /var/run/redis/sonic-db/database_config.json occurred. Arguments: /sonic/src/sonic-swss-common/sonic-db-cli/.libs/sonic-db-cli PING azureuser@a7f66d2b794c:/sonic/src/sonic-swss-common$ echo $? 1 #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [x] 202111 - [x] 202205 #### Description for the changelog Fix sonic-db-cli PING/SAVE/FLUSHALL command crash when database config file not ready issue. #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/SONiC/wiki/Configuration. --> #### A picture of a cute animal (not mandatory but encouraged)
8 tasks
rlhui
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Feb 21, 2023
…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 <[email protected]>
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this pull request
Mar 6, 2023
…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 <[email protected]>
mssonicbld
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Mar 7, 2023
…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 <[email protected]>
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
Fix sonic-db-cli PING/SAVE/FLUSHALL command crash when database config file not ready issue:
sonic-net/sonic-buildimage#12047
How I did it
When run PING/SAVE/FLUSHALL command, catch database initialize failed exception and return 1.
How to verify it
Pass all existing UT and E2E test.
Add new UT to cover changed code.
Manually test, sonic-db-cli will return 1 when run PING command and can't find config file:
azureuser@a7f66d2b794c:/sonic/src/sonic-swss-common$ ./sonic-db-cli/sonic-db-cli PING
An exception of type Sonic database config file doesn't exist at /var/run/redis/sonic-db/database_config.json occurred. Arguments:
/sonic/src/sonic-swss-common/sonic-db-cli/.libs/sonic-db-cli PING
azureuser@a7f66d2b794c:/sonic/src/sonic-swss-common$ echo $?
1
Which release branch to backport (provide reason below if selected)
Description for the changelog
Fix sonic-db-cli PING/SAVE/FLUSHALL command crash when database config file not ready issue.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)