when all you have is a zombie, everything looks like a shotgun
Actually, let's do a targeted fix of the actual forkProcess that was not waited on. The global reap is moved back to the end, after the long-running git processes actually exit.
This commit is contained in:
parent
49f21dd9ba
commit
61fbea992d
2 changed files with 4 additions and 4 deletions
|
@ -85,9 +85,7 @@ tryRun' :: Integer -> Annex.AnnexState -> [Annex Bool] -> IO ()
|
||||||
tryRun' errnum state (a:as) = do
|
tryRun' errnum state (a:as) = do
|
||||||
result <- try $ Annex.run state $ do
|
result <- try $ Annex.run state $ do
|
||||||
AnnexQueue.flushWhenFull
|
AnnexQueue.flushWhenFull
|
||||||
r <- a
|
a
|
||||||
liftIO Git.reap
|
|
||||||
return r
|
|
||||||
case result of
|
case result of
|
||||||
Left err -> do
|
Left err -> do
|
||||||
Annex.eval state $ do
|
Annex.eval state $ do
|
||||||
|
@ -106,4 +104,5 @@ startup = return True
|
||||||
shutdown :: Annex Bool
|
shutdown :: Annex Bool
|
||||||
shutdown = do
|
shutdown = do
|
||||||
saveState
|
saveState
|
||||||
|
liftIO Git.reap -- zombies from long-running git processes
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -218,7 +218,7 @@ gpgCipherHandle params c a b = do
|
||||||
|
|
||||||
params' <- gpgParams $ passphrase ++ params
|
params' <- gpgParams $ passphrase ++ params
|
||||||
(pid, fromh, toh) <- hPipeBoth "gpg" params'
|
(pid, fromh, toh) <- hPipeBoth "gpg" params'
|
||||||
_ <- forkProcess $ do
|
pid2 <- forkProcess $ do
|
||||||
L.hPut toh =<< a
|
L.hPut toh =<< a
|
||||||
hClose toh
|
hClose toh
|
||||||
exitSuccess
|
exitSuccess
|
||||||
|
@ -227,6 +227,7 @@ gpgCipherHandle params c a b = do
|
||||||
|
|
||||||
-- cleanup
|
-- cleanup
|
||||||
forceSuccess pid
|
forceSuccess pid
|
||||||
|
_ <- getProcessStatus True False pid2
|
||||||
closeFd frompipe
|
closeFd frompipe
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue