Skip to content

retry applying current config on first timeout #1491

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 1 commit into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ init_network_config() {
test $_rc -eq 0 || return $_rc

HTTP_STATUS_CODE=`curl -s -o /dev/null -w "%{http_code}" 'http://localhost:8837/v1/config/apply_current_config' -XPOST -H 'Content-Type: application/json' -d {}`
if [[ $HTTP_STATUS_CODE == "000" ]]; then
# maybe timeout, try again, firerouter guarantees sequential execution on applying network config, so no need to worry about race condition
echo "Timeout apply current config, try again"
HTTP_STATUS_CODE=`curl -s -o /dev/null -w "%{http_code}" 'http://localhost:8837/v1/config/apply_current_config' -XPOST -H 'Content-Type: application/json' -d {}`
fi
if [[ $HTTP_STATUS_CODE != "200" ]]; then
echo "Failed to apply current config"
_rc=2
Expand Down