From a218ce41cfef19f306ca462fb5d57c6647a680e2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Nov 2011 22:15:33 -0400 Subject: exclusive locks, ugh --- doc/bugs/cyclic_drop.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc') diff --git a/doc/bugs/cyclic_drop.mdwn b/doc/bugs/cyclic_drop.mdwn index 7804380ae..beaaa6e35 100644 --- a/doc/bugs/cyclic_drop.mdwn +++ b/doc/bugs/cyclic_drop.mdwn @@ -73,6 +73,15 @@ Another cycle might be running move --to and move --from on the same file, locally. The exclusivity of the content lock solves this, as only one can run at a time. +Would it work with a shared lock? The --to would run git-annex-shell +inannex. The --from would also be running, and would run git-annex-shell +dropkey. So inannex and dropkey would end up running on the remote +at the same time. Dropkey takes the content lock, and inannex checks it, +but what if inannex runs first? Then it returns true, and then the content +is removed, so both the --to and --from see success and the --to proceeds +to remove the local content that the --from already caused to be removed +from the remote. So, no, the nasty exclusive lock is needed. + --- Another cycle might involve move --from and drop, both run on the same -- cgit v1.2.3