Skip to content

Commit 7cf821c

Browse files
[FastReboot]: Send SIGINT to all teamd before stop (sonic-net#633)
* [FastReboot]: Send SIGINT to all teamd before stop * exit code == 1 is valid for pkill * Check that all teamd are stopped before to kill the container
1 parent c94dce7 commit 7cf821c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/fast-reboot

+5-1
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,16 @@ docker kill lldp > /dev/null
417417
systemctl stop lldp
418418
419419
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
420+
# Kill teamd processes inside of teamd container with SIGINT to allow them to send last LACP frames
420421
# Kill teamd, otherwise it gets down all LAGs
421422
# We call `docker kill teamd` to ensure the container stops as quickly as possible,
422423
# then immediately call `systemctl stop teamd` to prevent the service from
423424
# restarting the container automatically.
424425
# Note: teamd must be killed before syncd, because it will send the last packet through CPU port
425-
# TODO: stop teamd gracefully to allow teamd to send last valid update to be sure we'll have 90 seconds reboot time
426+
docker exec -i teamd pkill -INT teamd || [ $? == 1 ]
427+
while docker exec -i teamd pgrep teamd > /dev/null; do
428+
sleep 0.05
429+
done
426430
docker kill teamd > /dev/null
427431
systemctl stop teamd
428432
fi

0 commit comments

Comments
 (0)