fix gpg pipeline stall
Bug introduced in d1da9cf221
, where
I removed a forkProcess when feeding gpg. Feeding it from a thread
solves the bug.
This commit is contained in:
parent
4eb6a2966a
commit
c6f3c410d4
2 changed files with 10 additions and 3 deletions
|
@ -64,7 +64,7 @@ passphraseHandle :: [CommandParam] -> String -> IO L.ByteString -> (Handle -> IO
|
||||||
passphraseHandle params passphrase a b = do
|
passphraseHandle params passphrase a b = do
|
||||||
-- pipe the passphrase into gpg on a fd
|
-- pipe the passphrase into gpg on a fd
|
||||||
(frompipe, topipe) <- createPipe
|
(frompipe, topipe) <- createPipe
|
||||||
_ <- forkIO $ do
|
void $ forkIO $ do
|
||||||
toh <- fdToHandle topipe
|
toh <- fdToHandle topipe
|
||||||
hPutStrLn toh passphrase
|
hPutStrLn toh passphrase
|
||||||
hClose toh
|
hClose toh
|
||||||
|
@ -76,8 +76,9 @@ passphraseHandle params passphrase a b = do
|
||||||
withBothHandles createProcessSuccess (proc "gpg" params') go
|
withBothHandles createProcessSuccess (proc "gpg" params') go
|
||||||
where
|
where
|
||||||
go (to, from) = do
|
go (to, from) = do
|
||||||
L.hPut to =<< a
|
void $ forkIO $ do
|
||||||
hClose to
|
L.hPut to =<< a
|
||||||
|
hClose to
|
||||||
b from
|
b from
|
||||||
|
|
||||||
{- Finds gpg public keys matching some string. (Could be an email address,
|
{- Finds gpg public keys matching some string. (Could be an email address,
|
||||||
|
|
|
@ -43,3 +43,9 @@ The key which is used for the remote is password protected. The GnuPG Agent asks
|
||||||
When adding a new rsync-remote with encryption set to 'none' (therefore disabled), everything works, so it really seems a gpg issue.
|
When adding a new rsync-remote with encryption set to 'none' (therefore disabled), everything works, so it really seems a gpg issue.
|
||||||
|
|
||||||
How can I help debugging?
|
How can I help debugging?
|
||||||
|
|
||||||
|
> Thanks, I reproduced a deadlock in the gpg code, which was introduced
|
||||||
|
> with some of my earlier changes to use threading. No released version of
|
||||||
|
> git-annex was affected, and I have developed a fix, which works for me
|
||||||
|
> and is now committed to master. Marking this [[done]]; please do check
|
||||||
|
> that my fix works for you! --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue