Skip to content

Commit

Permalink
Minor fix to start_ovs script when bridging mode is enabled (#6305)
Browse files Browse the repository at this point in the history
The SLEEP_PID variable (used to store the PID of the sleep process
started by the "main" loop) was being overwritten in the signal handler.
The 1-second sleep which runs in the signal handler and wait for uplink
port deletion (when bridging mode is enabled) does not need to run in
the background.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
  • Loading branch information
antoninbas committed May 8, 2024
1 parent 33bb21d commit d4922f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build/images/scripts/start_ovs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ function quit {
# been restored. The uplink is moved to the OVS bridge to support AntreaFlexibleIPAM mode.
while [ "`ovsdb-client dump Port|grep antrea-type=uplink`" != "" ]; do
log_info $CONTAINER_NAME "Uplink found on OVS, wait 1s and retry..."
sleep 1 &
SLEEP_PID=$!
wait $SLEEP_PID
# If a second signal (besides SIGKILL) is received, bash will wait for the
# sleep to complete, and this function will run again. There is no point
# in running sleep in the background here (and using wait): it would just
# create extra "concurrent" sleep processes in case multiple signals are
# received.
sleep 1
done
stop_ovs
# terminate background sleep process
Expand Down

0 comments on commit d4922f0

Please sign in to comment.