summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-18 22:09:51 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-18 22:09:51 -0400
commit77c2d3b36ace1bb159598404d3173d7714e6629f (patch)
treeebb9707cf4eae8b8a7213c05217cdab2097c2ced
parent9acd2ee80f357d34eee7335f775b47bec87f4aed (diff)
assistant: The ConfigMonitor left one zombie behind each time it checked for changes, now fixed.
-rw-r--r--Git/Command.hs6
-rw-r--r--Git/LsTree.hs12
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/long_running_assistant_causes_resource_starvation_on_OSX.mdwn4
4 files changed, 19 insertions, 5 deletions
diff --git a/Git/Command.hs b/Git/Command.hs
index f3841c7fa..e6cec16fb 100644
--- a/Git/Command.hs
+++ b/Git/Command.hs
@@ -94,6 +94,12 @@ pipeNullSplit params repo = do
where
sep = "\0"
+pipeNullSplitStrict :: [CommandParam] -> Repo -> IO [String]
+pipeNullSplitStrict params repo = do
+ s <- pipeReadStrict params repo
+ return $ filter (not . null) $ split sep s
+ where
+ sep = "\0"
pipeNullSplitZombie :: [CommandParam] -> Repo -> IO [String]
pipeNullSplitZombie params repo = leaveZombie <$> pipeNullSplit params repo
diff --git a/Git/LsTree.hs b/Git/LsTree.hs
index c61ae7fab..6e4cd8470 100644
--- a/Git/LsTree.hs
+++ b/Git/LsTree.hs
@@ -29,15 +29,17 @@ data TreeItem = TreeItem
, file :: FilePath
} deriving Show
-{- Lists the complete contents of a tree. -}
+{- Lists the complete contents of a tree, with lazy output. -}
lsTree :: Ref -> Repo -> IO [TreeItem]
-lsTree t repo = map parseLsTree <$>
- pipeNullSplitZombie [Params "ls-tree --full-tree -z -r --", File $ show t] repo
+lsTree t repo = map parseLsTree <$> pipeNullSplitZombie ps repo
+ where
+ ps = [Params "ls-tree --full-tree -z -r --", File $ show t]
{- Lists specified files in a tree. -}
lsTreeFiles :: Ref -> [FilePath] -> Repo -> IO [TreeItem]
-lsTreeFiles t fs repo = map parseLsTree <$>
- pipeNullSplitZombie ([Params "ls-tree -z --", File $ show t] ++ map File fs) repo
+lsTreeFiles t fs repo = map parseLsTree <$> pipeNullSplitStrict ps repo
+ where
+ ps = [Params "ls-tree -z --", File $ show t] ++ map File fs
{- Parses a line of ls-tree output.
- (The --long format is not currently supported.) -}
diff --git a/debian/changelog b/debian/changelog
index 75d81ff76..8fa002604 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,8 @@ git-annex (4.20130315) UNRELEASED; urgency=low
* webapp: Improved alerts displayed when syncing with remotes, and
when syncing with a remote fails.
* webapp: Force wrap long filenames in transfer display.
+ * assistant: The ConfigMonitor left one zombie behind each time
+ it checked for changes, now fixed.
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400
diff --git a/doc/bugs/long_running_assistant_causes_resource_starvation_on_OSX.mdwn b/doc/bugs/long_running_assistant_causes_resource_starvation_on_OSX.mdwn
index 392090c9d..f556d16e9 100644
--- a/doc/bugs/long_running_assistant_causes_resource_starvation_on_OSX.mdwn
+++ b/doc/bugs/long_running_assistant_causes_resource_starvation_on_OSX.mdwn
@@ -24,3 +24,7 @@ Please provide any additional information below.
I'm really not sure what to look for next. Happy to take suggestions.
[!tag /design/assistant]]
+
+> [[done]], I found the zombie leak; the ConfigMonitor was
+> leaving one zombie every time it checked a push/pull.
+> Not a fast leak, but over time they would add up. --[[Joey]]