Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a stale_age to mkpidlock #1021

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

fingolfin
Copy link
Member

Normally the pidlock should be held for just a few milliseconds; waiting for its age to exceed 10 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.

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.78%. Comparing base (48061b6) to head (45cf72f).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1021      +/-   ##
==========================================
+ Coverage   75.77%   76.78%   +1.00%     
==========================================
  Files          51       51              
  Lines        4182     4182              
==========================================
+ Hits         3169     3211      +42     
+ Misses       1013      971      -42     
Files Coverage Δ
src/packages.jl 70.90% <100.00%> (ø)
src/setup.jl 93.16% <100.00%> (+11.11%) ⬆️

... and 1 file with indirect coverage changes

@ThomasBreuer
Copy link
Member

There is another call of Pidfile.mkpidlock in src/packages.jl. Should this be changed in the same way?

Normally the pidlock should be held for a short duration; waiting for
its age to exceed the given limits of 10 seconds (for the fake gaproot,
which normally finishes in milliseconds) resp. 300 seconds (for
installing packages, which only takes a few seconds for most, but a few
bad ones can take minutes) until we consider it stale should be safe in
each use case. 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.
@fingolfin
Copy link
Member Author

@ThomasBreuer ah I somehow missed that one. I've now adjusted it as well but with a higher timeout (5 minutes resp. 25 minutes if the process creating the lock file is still running)

@fingolfin fingolfin merged commit a8674da into oscar-system:master Aug 21, 2024
38 of 43 checks passed
@fingolfin fingolfin deleted the mh/mkpidlock-stale_age branch August 21, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants