Skip to content

Commit

Permalink
[FastReboot]: Send SIGINT to all teamd before stop (sonic-net#633)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
pavel-shirshov authored Sep 9, 2019
1 parent c94dce7 commit 7cf821c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,16 @@ docker kill lldp > /dev/null
systemctl stop lldp
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
# Kill teamd processes inside of teamd container with SIGINT to allow them to send last LACP frames
# Kill teamd, otherwise it gets down all LAGs
# We call `docker kill teamd` to ensure the container stops as quickly as possible,
# then immediately call `systemctl stop teamd` to prevent the service from
# restarting the container automatically.
# Note: teamd must be killed before syncd, because it will send the last packet through CPU port
# TODO: stop teamd gracefully to allow teamd to send last valid update to be sure we'll have 90 seconds reboot time
docker exec -i teamd pkill -INT teamd || [ $? == 1 ]
while docker exec -i teamd pgrep teamd > /dev/null; do
sleep 0.05
done
docker kill teamd > /dev/null
systemctl stop teamd
fi
Expand Down

0 comments on commit 7cf821c

Please sign in to comment.