Skip to content

Commit

Permalink
[swss/syncd] cold start syncd service in swss in attach method (#2639)
Browse files Browse the repository at this point in the history
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 Mar 5, 2019
1 parent 3d56e26 commit 66f5202
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 66f5202

Please sign in to comment.