Skip to content

Commit

Permalink
[swss/syncd] cold start syncd service in swss in attach method (sonic…
Browse files Browse the repository at this point in the history
…-net#2639)

start() is called by service startPre method, which is blocking. Starting
syncd service here is causing deadlock.

attach() is called by service start method, which is non-blocking.

Signed-off-by: Ying Xie <[email protected]>
  • Loading branch information
yxieca authored and tiantianlv committed Apr 10, 2019
1 parent 1aa304e commit 968fc2c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ function clean_up_tables()
end" 0
}

startPeerService() {
check_warm_boot

if [[ x"$WARM_BOOT" != x"true" ]]; then
/bin/systemctl start ${PEER}
fi
}

start() {
debug "Starting ${SERVICE} service..."

Expand Down Expand Up @@ -105,13 +113,10 @@ start() {

# Unlock has to happen before reaching out to peer service
unlock_service_state_change

if [[ x"$WARM_BOOT" != x"true" ]]; then
/bin/systemctl start ${PEER}
fi
}

attach() {
startPeerService
/usr/bin/${SERVICE}.sh attach
}

Expand Down

0 comments on commit 968fc2c

Please sign in to comment.