Skip to content

Commit 2bc9062

Browse files
committed
torture: Make kvm-remote.sh try multiple times to download tarball
This commit ups the retries for downloading the build-product tarball to a given remote system from once to five times, the better to handle transient network failures. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 99c80a9 commit 2bc9062

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

tools/testing/selftests/rcutorture/bin/kvm-remote.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,23 @@ do
155155
echo Downloading tarball to $i `date` | tee -a "$oldrun/remote-log"
156156
cat $T/binres.tgz | ssh $i "cd /tmp; tar -xzf -"
157157
ret=$?
158-
if test "$ret" -ne 0
159-
then
160-
echo Unable to download $T/binres.tgz to system $i, waiting and then retrying. | tee -a "$oldrun/remote-log"
158+
tries=0
159+
while test "$ret" -ne 0
160+
do
161+
echo Unable to download $T/binres.tgz to system $i, waiting and then retrying. $tries prior retries. | tee -a "$oldrun/remote-log"
161162
sleep 60
162163
cat $T/binres.tgz | ssh $i "cd /tmp; tar -xzf -"
163164
ret=$?
164165
if test "$ret" -ne 0
165166
then
166-
echo Unable to download $T/binres.tgz to system $i, giving up. | tee -a "$oldrun/remote-log"
167-
exit 10
167+
if test "$tries" > 5
168+
then
169+
echo Unable to download $T/binres.tgz to system $i, giving up. | tee -a "$oldrun/remote-log"
170+
exit 10
171+
fi
168172
fi
169-
fi
173+
tries=$((tries+1))
174+
done
170175
done
171176

172177
# Function to check for presence of a file on the specified system.

0 commit comments

Comments
 (0)