Skip to content

Commit aab1373

Browse files
shorten stale_age for cachefile lock
1 parent 8e14322 commit aab1373

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/loading.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,11 +2968,13 @@ global parse_pidfile_hook
29682968
compilecache_pidfile_path(pkg::PkgId) = compilecache_path(pkg, UInt64(0); project="") * ".pidfile"
29692969

29702970
# Allows processes to wait if another process is precompiling a given source already.
2971-
# The lock file is deleted and precompilation will proceed after `stale_age` seconds if
2971+
# The lock file mtime will be updated when held every `stale_age/2` seconds.
2972+
# After `stale_age` seconds beyond the mtime of the lock file, the lock file is deleted and
2973+
# precompilation will proceed if
29722974
# - the locking process no longer exists
29732975
# - the lock is held by another host, since processes cannot be checked remotely
29742976
# or after `stale_age * 25` seconds if the process does still exist.
2975-
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=300)
2977+
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=5)
29762978
if @isdefined(mkpidlock_hook) && @isdefined(trymkpidlock_hook) && @isdefined(parse_pidfile_hook)
29772979
pidfile = compilecache_pidfile_path(pkg)
29782980
cachefile = invokelatest(trymkpidlock_hook, f, pidfile; stale_age)

0 commit comments

Comments
 (0)