Skip to content

Commit c7f45c3

Browse files
jipanyangyxieca
authored andcommitted
[warm-reboot] Use retryCount option of orchagent_restart_check program (#555)
* [warm-reboot] Use retryCount option of orchagent_restart_check program This helps to reduce the possbility of reply message loss from orchagent within the whole checking period Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com> * Direct orchagent_restart_check output to /dev/null
1 parent c6a08f7 commit c7f45c3

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

scripts/fast-reboot

+10-13
Original file line numberDiff line numberDiff line change
@@ -356,22 +356,19 @@ setup_control_plane_assistant
356356
357357
if [[ "$REBOOT_TYPE" = "warm-reboot" || "$REBOOT_TYPE" = "fastfast-reboot" ]]; then
358358
# Freeze orchagent for warm restart
359-
# Try freeze 5 times, it is possible that the orchagent is in transient state and no opportunity to be freezed
360-
# Note: assume that 1 second is enough for orchagent to process the request and respone freeze or not
359+
# Ask orchagent_restart_check to try freeze 5 times with interval of 2 seconds,
360+
# it is possible that the orchagent is in transient state and no opportunity to be freezed
361+
# Note: assume that 2*5 seconds is enough for orchagent to process the request and respone freeze or not
361362
debug "Pausing orchagent ..."
362-
for i in `seq 4 -1 0`; do
363-
docker exec -i swss /usr/bin/orchagent_restart_check -w 1000 > /dev/null && break
364-
error "RESTARTCHECK failed $i"
365-
if [[ "$i" = "0" ]]; then
366-
error "RESTARTCHECK failed finally"
367-
if [[ x"${FORCE}" == x"yes" ]]; then
368-
debug "Ignoring orchagent pausing failure ..."
369-
break;
370-
fi
363+
docker exec -i swss /usr/bin/orchagent_restart_check -w 2000 -r 5 > /dev/null || RESTARTCHECK_RC=$?
364+
if [[ RESTARTCHECK_RC -ne 0 ]]; then
365+
error "RESTARTCHECK failed"
366+
if [[ x"${FORCE}" == x"yes" ]]; then
367+
debug "Ignoring orchagent pausing failure ..."
368+
else
371369
exit "${EXIT_ORCHAGENT_SHUTDOWN}"
372370
fi
373-
sleep 1
374-
done
371+
fi
375372
fi
376373
377374
# Kill bgpd to start the bgp graceful restart procedure

0 commit comments

Comments
 (0)