Skip to content

Commit

Permalink
Review comment for process cancelation test issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gpunathilell committed May 1, 2024
1 parent 587cade commit 107b103
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions platform/mellanox/sonic-bfb-installer
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ bfb_install_call(){
if [ $exit_status -ne 0 ] ||[ $verbose = true ]; then
cat "$result_file"
fi
rm -f $result_file
}

validate_rshim(){
Expand Down Expand Up @@ -137,12 +138,25 @@ main(){
wait
}

kill_all_descendant_procs() {
local pid="$1"
local self_kill="${2:-false}"
if children="$(pgrep -P "$pid")"; then
for child in $children; do
kill_all_descendant_procs "$child" true
done
fi
if [[ "$self_kill" == true ]]; then
kill -15 "$pid" > /dev/null 2>&1
fi
}


kill_ch_procs(){
echo ""
echo "Installation Interrupted.. killing All child procs"
pkill -P $$
kill_all_descendant_procs $$
}

appendix=
verbose=false
main "$@"

0 comments on commit 107b103

Please sign in to comment.