Fix rsync special remote to work when -Jn is used for concurrent uploads.
This commit is contained in:
parent
231820dead
commit
506452012c
4 changed files with 19 additions and 9 deletions
|
@ -39,6 +39,7 @@ import Logs.Transfer
|
||||||
import Types.Creds
|
import Types.Creds
|
||||||
import Types.Key (isChunkKey)
|
import Types.Key (isChunkKey)
|
||||||
import Annex.DirHashes
|
import Annex.DirHashes
|
||||||
|
import Utility.Tmp
|
||||||
|
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
|
||||||
|
@ -252,16 +253,8 @@ sendParams = ifM crippledFileSystem
|
||||||
- up trees for rsync. -}
|
- up trees for rsync. -}
|
||||||
withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a
|
withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a
|
||||||
withRsyncScratchDir a = do
|
withRsyncScratchDir a = do
|
||||||
p <- liftIO getPID
|
|
||||||
t <- fromRepo gitAnnexTmpObjectDir
|
t <- fromRepo gitAnnexTmpObjectDir
|
||||||
createAnnexDirectory t
|
withTmpDirIn t "rsynctmp" a
|
||||||
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
|
|
||||||
|
|
||||||
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
|
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
|
||||||
rsyncRetrieve o k dest meterupdate =
|
rsyncRetrieve o k dest meterupdate =
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -1,6 +1,8 @@
|
||||||
git-annex (5.20150728) UNRELEASED; urgency=medium
|
git-annex (5.20150728) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* webapp: Support enabling known gitlab.com remotes.
|
* 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
|
-- Joey Hess <id@joeyh.name> Mon, 27 Jul 2015 15:57:07 -0400
|
||||||
|
|
||||||
|
|
|
@ -53,3 +53,5 @@ Repo config:
|
||||||
annex-uuid = f05581cc-7236-41ed-9db8-49424f863307
|
annex-uuid = f05581cc-7236-41ed-9db8-49424f863307
|
||||||
|
|
||||||
"""]]
|
"""]]
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
|
@ -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.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue