Skip to content

Commit

Permalink
Update scripts/merge_multiprocess_output.sh to add a timeout.
Browse files Browse the repository at this point in the history
Co-authored-by: David Galiffi <[email protected]>
  • Loading branch information
pranswarup and dgaliffiAMD authored Dec 18, 2024
1 parent 09d643c commit 02ae33e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/merge_multiprocess_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ fi

echo "Merging multiprocess files ..."
# Check if all .proto files have been fully written or wait
TIMEOUT=60 # Timeout in seconds
for file in "${PROTO_FILES[@]}"; do
SECONDS=0
while lsof "$file" > /dev/null 2>&1; do
echo "..."
if [ $SECONDS -ge $TIMEOUT ]; then
echo "Timeout reached while waiting for $file to be released."
break
fi
echo "Waiting for $file to be released..."
sleep 1
done
done
Expand Down

0 comments on commit 02ae33e

Please sign in to comment.