summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-30 13:29:45 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-30 13:29:45 -0400
commitcc32ffe05f5b8453ac09f2a12b2a17e41d9d7584 (patch)
tree8f47d587634e012f56dba8ce62eb61997e68eb83
parent383d7c247ef97164fd15e4baa89c6d8f15f89537 (diff)
Fix rsync special remote to work when -Jn is used for concurrent uploads.
-rw-r--r--Remote/Rsync.hs11
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/rsync_remote_with_-J2_fails.mdwn2
-rw-r--r--doc/bugs/rsync_remote_with_-J2_fails/comment_1_793bbc86b495dda0328c35cb5abe4fad._comment13
4 files changed, 19 insertions, 9 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 3986863b3..b9cdc458e 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -39,6 +39,7 @@ import Logs.Transfer
import Types.Creds
import Types.Key (isChunkKey)
import Annex.DirHashes
+import Utility.Tmp
import qualified Data.Map as M
@@ -252,16 +253,8 @@ sendParams = ifM crippledFileSystem
- up trees for rsync. -}
withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a
withRsyncScratchDir a = do
- p <- liftIO getPID
t <- fromRepo gitAnnexTmpObjectDir
- createAnnexDirectory t
- let tmp = t </> "rsynctmp" </> show p
- nuke tmp
- liftIO $ createDirectoryIfMissing True tmp
- nuke tmp `after` a tmp
- where
- nuke d = liftIO $ whenM (doesDirectoryExist d) $
- removeDirectoryRecursive d
+ withTmpDirIn t "rsynctmp" a
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
rsyncRetrieve o k dest meterupdate =
diff --git a/debian/changelog b/debian/changelog
index 7ca0944d6..d6cf55023 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
git-annex (5.20150728) UNRELEASED; urgency=medium
* webapp: Support enabling known gitlab.com remotes.
+ * Fix rsync special remote to work when -Jn is used for concurrent
+ uploads.
-- Joey Hess <id@joeyh.name> Mon, 27 Jul 2015 15:57:07 -0400
diff --git a/doc/bugs/rsync_remote_with_-J2_fails.mdwn b/doc/bugs/rsync_remote_with_-J2_fails.mdwn
index 93b317694..766f671d7 100644
--- a/doc/bugs/rsync_remote_with_-J2_fails.mdwn
+++ b/doc/bugs/rsync_remote_with_-J2_fails.mdwn
@@ -53,3 +53,5 @@ Repo config:
annex-uuid = f05581cc-7236-41ed-9db8-49424f863307
"""]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/rsync_remote_with_-J2_fails/comment_1_793bbc86b495dda0328c35cb5abe4fad._comment b/doc/bugs/rsync_remote_with_-J2_fails/comment_1_793bbc86b495dda0328c35cb5abe4fad._comment
new file mode 100644
index 000000000..eeb4b34af
--- /dev/null
+++ b/doc/bugs/rsync_remote_with_-J2_fails/comment_1_793bbc86b495dda0328c35cb5abe4fad._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-07-30T17:18:24Z"
+ content="""
+The -J1 is a red herring; there's no progress output for -J modes, so the
+whole transfer runs quietly there.
+
+The -J2 failure is because the rsync special remote implementation uses a
+local scratch directory which is supposed to be empty. But, since it uses
+the pid of the process to create the directory name, concurrently transfers
+will use the same scratch directory and so interfere with one-another.
+"""]]