Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRepo locking #243
Open
Repo locking #243
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not providing any repo locking causes difficult to debug issues as I've hit earlier myself and now others have as well, see #241.
Simplest way could be to fail at Repo::init time if a lock file exists. If the lock file doesn't exist, one must be created and again removed at exit time. Probably ok to rely on deletion at Drop, require manual recovery (file deletion) unless a (go/js) compatible recovery strategy exists.
While we are not aiming to be 100% repo compatible with the other implementations being compatible here sounds like a solid idea. go-ipfs 0.5 seems to use a simple protocol of creating an empty file
$IPFS_PATH/repo_lock
with the following/proc/fdinfo/$fd
:Originally posted by @koivunej in #241 (comment)