fix hang if external program is not available

startExternal' throws an exception, which left the externalAsync TMVar
empty, so the next try to use it would hang.
This commit is contained in:
Joey Hess 2020-08-19 12:20:07 -04:00
parent 168bf5e0c5
commit d00ce82418
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 0 deletions

View file

@ -616,6 +616,7 @@ startExternal external =
liftIO (atomically $ takeTMVar (externalAsync external)) >>= \case
UncheckedExternalAsync -> do
(st, extensions) <- startExternal' external
`onException` store UncheckedExternalAsync
if asyncExtensionEnabled extensions
then do
relay <- liftIO $ runRelayToExternalAsync external st

View file

@ -56,3 +56,5 @@ With the first commit before the merge checked out (0900bb2ca), the
[[!meta author=kyle]]
[[!tag projects/datalad]]
> [[fixed|done]] thanks for reporting --[[Joey]]