-
Notifications
You must be signed in to change notification settings - Fork 363
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
Improve lockfiles #1193
Merged
Merged
Improve lockfiles #1193
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wolfv
reviewed
Sep 30, 2021
wolfv
reviewed
Sep 30, 2021
wolfv
reviewed
Sep 30, 2021
adriendelsalle
force-pushed
the
improve-lockfile
branch
5 times, most recently
from
October 6, 2021 09:48
e59195f
to
9ef14d5
Compare
handle multiple locks acquired from the same process improve logs add tests refactor use of LockFile forbid locking twice same path from same PID improve windows lockfile to match unix one split Lock and LockFile use byte 21 to set lock status enable reading locked file on windows ensure closing of file descriptor in Lock and LockFile destructors add timeout implementation for unix add testing lock cli for subprocess tests add subprocess tests add --lock-timeout to umamba add clean lock files add a clean lock files flag -l,--locks to umamba clean command add cpp-filesystem pins to enforce correct version on dev mode
adriendelsalle
force-pushed
the
improve-lockfile
branch
from
October 6, 2021 09:50
9ef14d5
to
ddee02f
Compare
wolfv
reviewed
Oct 6, 2021
wolfv
reviewed
Oct 6, 2021
wolfv
reviewed
Oct 6, 2021
wolfv
reviewed
Oct 6, 2021
use it to ensure consistency of lock position improve logs add comment in code implement custom timeout on Windows
wolfv
reviewed
Oct 6, 2021
test/testing/lock.cpp
Outdated
@@ -27,7 +27,7 @@ is_locked(const fs::path& path) | |||
// From another process than the lockfile one, we can open/close | |||
// a new file descriptor without risk to clear locks | |||
int fd = open(path.c_str(), O_RDWR | O_CREAT, 0666); | |||
bool is_locked = mamba::LockFile::is_locked(fd); | |||
bool is_locked = mamba::Lock::is_locked(fd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep the LockFile name -- because that's what it is. A "Lock" is a bit ambigous.
remove tests failing in non writable caches
refactor names
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
LockFile
now takes the path to lock instead of the name of the supposed lock filetimeout
argument can be specified to the constructorn defaulting toContext::lock_timeout
valuestd::logic_error
std::runtime_error
is a timeout is set_LK_LOCK
every seconds_LK_NBLOCK
but with control over the timeoutfcntl
withF_SETLKW
in a separate thread and cancel it if timeout is metmamba_test_lock
to have a CLI for testingis_locked
andlock
paths for subprocessesmicromamba
CLI options/flags-l,--locks
tomicromamba clean
to remove lock files in caches--lock-timeout
to set the lock file timeout