fix ssh warmup hang
Fix race condition in ssh warmup that caused git-annex to get stuck and never process some while when run with high levels of concurrency. So far, I've isolated the problem to processTranscript, which hangs reading output from ssh in this situation. I don't yet understand why processTranscript behaves that way. Since here we don't care about the ssh output, and only want to /dev/null it, changed to not use processTranscript, avoiding its problem. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
7d83502329
commit
ac6f58d642
3 changed files with 32 additions and 3 deletions
|
@ -34,7 +34,6 @@ import Annex.Path
|
|||
import Utility.Env
|
||||
import Utility.FileSystemEncoding
|
||||
import Utility.Hash
|
||||
import Utility.Process.Transcript
|
||||
import Types.CleanupActions
|
||||
import Types.Concurrency
|
||||
import Git.Env
|
||||
|
@ -219,13 +218,17 @@ prepSocket socketfile gc sshhost sshparams = do
|
|||
-- return True.
|
||||
-- (Except there's an unlikely false positive where a forced
|
||||
-- ssh command exits 255.)
|
||||
tryssh extraps = liftIO $ do
|
||||
tryssh extraps = liftIO $ withNullHandle $ \nullh -> do
|
||||
let p = proc "ssh" $ concat
|
||||
[ extraps
|
||||
, toCommand sshparams
|
||||
, [fromSshHost sshhost, "true"]
|
||||
]
|
||||
(_, exitcode) <- processTranscript'' p Nothing
|
||||
(Nothing, Nothing, Nothing, pid) <- createProcess $ p
|
||||
{ std_out = UseHandle nullh
|
||||
, std_err = UseHandle nullh
|
||||
}
|
||||
exitcode <- waitForProcess pid
|
||||
return $ case exitcode of
|
||||
ExitFailure 255 -> False
|
||||
_ -> True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue