Skip to content

Commit

Permalink
Increase retry times to wait MST device ready
Browse files Browse the repository at this point in the history
The 10s waiting time is not enough occasionally, so increase it to 60s.
Error message will be printed once exceed 10s so we can still detect
this unnomal behavior even it get ready eventually.

Signed-off-by: Yuanzhe, Liu <[email protected]>
  • Loading branch information
yuazhe committed Nov 15, 2024
1 parent 1649851 commit 2b9bf23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions platform/mellanox/mlnx-fw-upgrade.j2
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ function UnlockStateChange() {
}

function WaitForDevice() {
local -i QUERY_RETRY_COUNT_MAX="10"
local -i QUERY_RETRY_COUNT_MAX="60"
local -i QUERY_RETRY_WARNING="10"
local -i QUERY_RETRY_COUNT="0"
local SPC_MST_DEV
local QUERY_RC=""
Expand All @@ -196,7 +197,11 @@ function WaitForDevice() {
[[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("${QUERY_RC}" != "${EXIT_SUCCESS}") ]] || break
sleep 1s
((QUERY_RETRY_COUNT++))
LogInfo "Retrying MST device query ${QUERY_RETRY_COUNT}"
if [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_WARNING}") ]]; then
LogInfo "Retrying MST device query ${QUERY_RETRY_COUNT}"
else
LogError "Retrying MST device query ${QUERY_RETRY_COUNT}"
fi
done

if [[ "${QUERY_RC}" != "${EXIT_SUCCESS}" ]]; then
Expand Down

0 comments on commit 2b9bf23

Please sign in to comment.