Skip to content

Commit d4acead

Browse files
authored
Avoid race condition in cleaning up cache files (JuliaLang#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
1 parent 436b383 commit d4acead

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
@@ -1577,7 +1577,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
15771577
cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath))
15781578
if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES[]
15791579
idx = findmin(mtime.(joinpath.(cachepath, cachefiles)))[2]
1580-
rm(joinpath(cachepath, cachefiles[idx]))
1580+
rm(joinpath(cachepath, cachefiles[idx]); force=true)
15811581
end
15821582
end
15831583

0 commit comments

Comments
 (0)