Fix rsync special remote to work when -Jn is used for concurrent uploads.

This commit is contained in:
Joey Hess 2015-07-30 13:29:45 -04:00
parent 231820dead
commit 506452012c
4 changed files with 19 additions and 9 deletions

View file

@ -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 =

2
debian/changelog vendored
View file

@ -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

View file

@ -53,3 +53,5 @@ Repo config:
annex-uuid = f05581cc-7236-41ed-9db8-49424f863307
"""]]
> [[fixed|done]] --[[Joey]]

View file

@ -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.
"""]]