Skip to content

Commit

Permalink
Provide a stale_age to mkpidlock
Browse files Browse the repository at this point in the history
Normally the pidlock should be held for just a few seconds;
waiting for its age to exceed 60 seconds until we consider it stale
should be very safe. In fact Julia waits 5 times longer if the
process creating the pid lock file seems to be still running.

On the other hand, without a stale age, the lock file is *never*
considered stale, even if the process creating it definitely is gone,
and so the user can get stuck, which obviously is very bad. To
get unstuck they need to manually delete the lock file.
  • Loading branch information
fingolfin committed Jul 5, 2024
1 parent 5db1914 commit 571d06c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function build_code(src_hash)
gmp_prefix = jll_artifact_dir(Singular_jll.GMP_jll)
singular_prefix = jll_artifact_dir(Singular_jll)

Pidfile.mkpidlock("$installdir.lock") do
Pidfile.mkpidlock("$installdir.lock"; stale_age=60) do
# delete any previous build or install artifacts
rm(builddir; force=true, recursive=true)
rm(installdir; force=true, recursive=true)
Expand Down

0 comments on commit 571d06c

Please sign in to comment.