diff options
author | Joey Hess <joey@kitenet.net> | 2014-09-11 13:53:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-09-11 13:53:26 -0400 |
commit | 0d5123633d8a9da1670b7b348d4c5def133d9d45 (patch) | |
tree | 2bb04d0b7f941f954461f1093d7e30f4cdd56d36 | |
parent | 23b5fc25df3c466894431ff29d7c393a975a04ab (diff) |
Fix transfer lock file FD leak that could occur when two separate git-annex processes were both working to perform the same set of transfers.
-rw-r--r-- | Annex/Transfer.hs | 4 | ||||
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | doc/bugs/too_many_open_files_on_OSX.mdwn | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs index 448b5b3d7..d33d3073b 100644 --- a/Annex/Transfer.hs +++ b/Annex/Transfer.hs @@ -85,7 +85,9 @@ runTransfer' ignorelock t file shouldretry a = do locked <- catchMaybeIO $ setLock fd (WriteLock, AbsoluteSeek, 0, 0) if isNothing locked - then return (Nothing, True) + then do + closeFd fd + return (Nothing, True) else do void $ tryIO $ writeTransferInfoFile info tfile return (mfd, False) diff --git a/debian/changelog b/debian/changelog index 0e267eb0a..22eaf0bae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ git-annex (5.20140832) UNRELEASED; urgency=medium if a key is present on a rsync remote, and when dropping a key from the remote. * Promote file not found warning message to an error. + * Fix transfer lock file FD leak that could occur when two separate + git-annex processes were both working to perform the same set of + transfers. -- Joey Hess <joeyh@debian.org> Thu, 04 Sep 2014 16:17:22 -0400 diff --git a/doc/bugs/too_many_open_files_on_OSX.mdwn b/doc/bugs/too_many_open_files_on_OSX.mdwn index d30870a3b..2ca89fcf0 100644 --- a/doc/bugs/too_many_open_files_on_OSX.mdwn +++ b/doc/bugs/too_many_open_files_on_OSX.mdwn @@ -36,3 +36,7 @@ lsof -p <my annex process> .../.git/annex/ssh/myserver.lock .../.git/annex/transfer/upload/b4d67c4f-8cca-423c-9363-f3063b7fe3e4/lck.SHA256E-s10448418--4f61fab4... ~200 different files. """]] + +> Thanks for a very clear bug report! Was easy from that to find +> where the lock file was not being closed in this situation. +> [[fixed|done]] --[[Joey]] |