From b5f4629f5980de727fdf213de70021e167c276c2 Mon Sep 17 00:00:00 2001 From: Aryeh Feigin <101218333+arfeigin@users.noreply.github.com> Date: Mon, 12 Sep 2022 22:34:17 +0300 Subject: [PATCH] Delete routes only after we are committed to reboot --- scripts/fast-reboot | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 0f2248424c..2fd99a0a2d 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -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 @@ -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