Skip to content

Commit

Permalink
Avoid race condition in cleaning up cache files (JuliaLang#45214)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
simonbyrne committed May 8, 2022
1 parent 436b383 commit d4acead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath))
if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES[]
idx = findmin(mtime.(joinpath.(cachepath, cachefiles)))[2]
rm(joinpath(cachepath, cachefiles[idx]))
rm(joinpath(cachepath, cachefiles[idx]); force=true)
end
end

Expand Down

0 comments on commit d4acead

Please sign in to comment.