Skip to content

Commit 1e4497e

Browse files
Don't retry artifact downloads on SystemError, like no space left on device (#3932)
1 parent bd11c5b commit 1e4497e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/PlatformEngines.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,20 @@ function download_verify(
345345
mkpath(dirname(dest))
346346

347347
# Download the file, optionally continuing
348-
f = retry(delays = fill(1.0, 3)) do
348+
attempts = 3
349+
for i in 1:attempts
349350
try
350351
download(url, dest; verbose=verbose || !quiet_download)
351352
catch err
352-
@debug "download and verify failed" url dest err
353-
rethrow()
353+
@debug "download and verify failed on attempt $i/$attempts" url dest err
354+
# for system errors like `no space left on device` exit after first try
355+
if err isa SystemError || i == attempts
356+
rethrow()
357+
else
358+
sleep(1)
359+
end
354360
end
355361
end
356-
f()
357362
if hash !== nothing && !verify(dest, hash; verbose=verbose)
358363
# If the file already existed, it's possible the initially downloaded chunk
359364
# was bad. If verification fails after downloading, auto-delete the file

0 commit comments

Comments
 (0)