Skip to content

Commit ce8c96a

Browse files
simonbyrnestaticfloat
authored andcommitted
Avoid race condition in cleaning up cache files (#45214)
If multiple processes attempt to clean up cache files at the same time, a race condition can result, e.g. https://buildkite.com/clima/climaatmos-ci/builds/812#6a961e99-e2a1-488b-a116-2a45dee26d38/102-104 (cherry picked from commit d4acead)
1 parent 59687c7 commit ce8c96a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
13681368
cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath))
13691369
if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES[]
13701370
idx = findmin(mtime.(joinpath.(cachepath, cachefiles)))[2]
1371-
rm(joinpath(cachepath, cachefiles[idx]))
1371+
rm(joinpath(cachepath, cachefiles[idx]); force=true)
13721372
end
13731373
end
13741374

0 commit comments

Comments
 (0)