-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Chassis][multiasic] Fix the sonic-db-cli core files issue on multiasic platform after the c++ implementation of sonic-db-cli #13207
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,11 +155,13 @@ function waitForAllInstanceDatabaseConfigJsonFilesReady() | |
| fi | ||
| done | ||
| done | ||
| fi | ||
| fi | ||
| # Delay a second to allow all instance database_config.json files to be completely generated and fully accessible. | ||
| # This delay is needed to make sure that the database_config.json files are correctly rendered from j2 template | ||
| # files ( renderning takes some time ) | ||
| sleep 1 | ||
| fi | ||
| } | ||
| # delay a second to allow the file to be fully accessible | ||
| sleep 1 | ||
| {%- endif %} | ||
|
|
||
| function postStartAction() | ||
|
|
@@ -225,6 +227,10 @@ function postStartAction() | |
| # then we catch python exception of file not valid | ||
| # that comes to syslog which is unwanted so wait till database | ||
| # config is ready and then ping | ||
| # 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 | ||
|
||
| until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) && | ||
| ($(docker exec -i database$DEV sonic-db-cli PING | grep -c PONG) -gt 0) ]]; do | ||
| sleep 1; | ||
|
|
@@ -234,11 +240,7 @@ function postStartAction() | |
| mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old | ||
| else | ||
| # If there is a config_db.json dump file, load it. | ||
| if [ -r /etc/sonic/config_db$DEV.json ]; then | ||
|
|
||
| # For multi-asic, all /var/run/redis$DEV/sonic-db/database_config.json need to ready | ||
| # for loading config with --write-to-db | ||
| waitForAllInstanceDatabaseConfigJsonFilesReady | ||
| if [ -r /etc/sonic/config_db$DEV.json ]; then | ||
|
|
||
| if [ -r /etc/sonic/init_cfg.json ]; then | ||
| $SONIC_CFGGEN -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db$DEV.json --write-to-db | ||
|
|
@@ -678,4 +680,4 @@ case "$1" in | |
| echo "Usage: $0 {start namespace(optional)|wait namespace(optional)|stop namespace(optional)}" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| esac | ||
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.
Uh oh!
There was an error while loading. Please reload this page.