From c4609c0e88cabcd0b283d64485ef449fbcd647a6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 5 Jul 2024 13:37:25 +0200 Subject: [PATCH] Provide a stale_age to mkpidlock 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 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. --- src/Polymake.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polymake.jl b/src/Polymake.jl index ad373ce8..de10d8b9 100644 --- a/src/Polymake.jl +++ b/src/Polymake.jl @@ -247,7 +247,7 @@ function __init__() !any(x->x.name in ["Oscar"], keys(Base.package_locks)) mkpath(polymake_user_dir) # lock to avoid race-conditions when recompiling wrappers in multiple processes - Pidfile.mkpidlock("$(polymake_user_dir)/userdir.lock") do + Pidfile.mkpidlock("$(polymake_user_dir)/userdir.lock"; stale_age=60) do initialize_polymake_with_dir("$(polymake_extension_config);user=$(polymake_user_dir)", installtop, installarch, show_banner) end if !show_banner