diff options
-rw-r--r-- | Assistant/Threads/SanityChecker.hs | 15 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/Assistant_breaks_when_broken_symlinks_are_in_.git__47__annex__47__tmp.mdwn | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index ba141698d..c4f2723f0 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -40,6 +40,7 @@ import Logs.Transfer import Config.Files import Utility.DiskFree import qualified Annex +import Annex.Exception #ifdef WITH_WEBAPP import Assistant.WebApp.Types #endif @@ -84,8 +85,9 @@ sanityCheckerStartupThread startupdelay = namedThreadUnchecked "SanityCheckerSta liftIO $ fixUpSshRemotes {- Clean up old temp files. -} - liftAnnex cleanOldTmpMisc - liftAnnex cleanReallyOldTmp + void $ liftAnnex $ tryAnnex $ do + cleanOldTmpMisc + cleanReallyOldTmp {- If there's a startup delay, it's done here. -} liftIO $ maybe noop (threadDelaySeconds . Seconds . fromIntegral . durationSeconds) startupdelay @@ -310,7 +312,8 @@ cleanReallyOldTmp = do | otherwise -> noop cleanOld :: (POSIXTime -> Bool) -> FilePath -> IO () -cleanOld check f = do - mtime <- realToFrac . modificationTime <$> getFileStatus f - when (check mtime) $ - nukeFile f +cleanOld check f = go =<< catchMaybeIO getmtime + where + getmtime = realToFrac . modificationTime <$> getSymbolicLinkStatus f + go (Just mtime) | check mtime = nukeFile f + go _ = noop diff --git a/debian/changelog b/debian/changelog index d8bc867d0..1829325a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ git-annex (5.20140530) UNRELEASED; urgency=medium * webapp: Avoid stomping on existing description, group and preferred content settings when enabling or combining with an already existing remote. + * assistant: Make sanity checker tmp dir cleanup code more robust. -- Joey Hess <joeyh@debian.org> Thu, 29 May 2014 20:10:59 -0400 diff --git a/doc/bugs/Assistant_breaks_when_broken_symlinks_are_in_.git__47__annex__47__tmp.mdwn b/doc/bugs/Assistant_breaks_when_broken_symlinks_are_in_.git__47__annex__47__tmp.mdwn index e47bfde1b..256bc1e7f 100644 --- a/doc/bugs/Assistant_breaks_when_broken_symlinks_are_in_.git__47__annex__47__tmp.mdwn +++ b/doc/bugs/Assistant_breaks_when_broken_symlinks_are_in_.git__47__annex__47__tmp.mdwn @@ -3,3 +3,7 @@ The assistant web UI says: `SanityCheckerStartup crashed: /home/zerodogg/Delt/.g I'm not sure what causes said symlink to appear (which has the name of a file that does exist in the annex), but it has done so on several systems accross different distributions here (Fedora 20, Ubuntu 14.04, Archlinux). Perhaps an rsync copies over a symlink instead of a file? git-annex version: 5.20140517-gee56d21 + +[[!tag confirmed]] + +> [[fixed|done]] --[[Joey]] |