diff --git a/Command/Add.hs b/Command/Add.hs index 25548a9731..7b2d5fd305 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -60,7 +60,8 @@ lockDown file = do tmp <- fromRepo gitAnnexTmpDir createAnnexDirectory tmp liftIO $ do - (tmpfile, _handle) <- openTempFile tmp (takeFileName file) + (tmpfile, handle) <- openTempFile tmp (takeFileName file) + hClose handle nukeFile tmpfile createLink file tmpfile return $ KeySource { keyFilename = file , contentLocation = tmpfile } diff --git a/debian/changelog b/debian/changelog index 8979d29df5..f98d335b73 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ git-annex (3.20130103) UNRELEASED; urgency=low * webapp: Add UI to stop and restart assistant. + * committer: Fix a file handle leak. -- Joey Hess Thu, 03 Jan 2013 14:58:45 -0400 diff --git a/doc/bugs/assistant___40__OS_X_Lion__41___-___34__too_many_open_files__34___error.mdwn b/doc/bugs/assistant___40__OS_X_Lion__41___-___34__too_many_open_files__34___error.mdwn index ad8d18fcf6..1b3879e639 100644 --- a/doc/bugs/assistant___40__OS_X_Lion__41___-___34__too_many_open_files__34___error.mdwn +++ b/doc/bugs/assistant___40__OS_X_Lion__41___-___34__too_many_open_files__34___error.mdwn @@ -24,3 +24,9 @@ What version of git-annex are you using? On what operating system? Please provide any additional information below. I imagine I could avoid this error by using the "ulimit -n" command to increase number of files in a shell session and then running assistant manually, so this is really only a bug report about the bundled application. + +> This seems to be caused by Command.Add.lockdown not closing the +> temporary file handle, so when called in a mapM by the committer +> thread when there are a lot of files, it could build up a lot of +> open handles before later GC closes them. Added a manual close, +> so I think this is [[done]]. --[[Joey]]