Skip to content

Commit

Permalink
Delete routes only after we are committed to reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
arfeigin authored Sep 12, 2022
1 parent e1cc628 commit b5f4629
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,13 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
unload_kernel
exit "${EXIT_COUNTERPOLL_DELAY_FAILURE}"
fi
fi
# We are fully committed to reboot from this point on because critical
# service will go down and we cannot recover from it.
set +e
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
# Clear all routes except of default routes for faster reconciliation time.
sonic-db-cli APPL_DB eval "
for _, k in ipairs(redis.call('keys', '*')) do
Expand All @@ -642,10 +648,6 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
" 0 > /dev/null
fi
# We are fully committed to reboot from this point on because critical
# service will go down and we cannot recover from it.
set +e
# disable trap-handlers which were set before
trap '' EXIT HUP INT QUIT TERM KILL ABRT ALRM
Expand Down

0 comments on commit b5f4629

Please sign in to comment.