discard any exception thrown while trying to kill worker threads

Since there's a race here, and since Kyle saw an exception leak out,
which I have not been able to reproduce that. See my comment for what
I think might be going on.

Note that, I used tryNonAsync, because it seems a later tryNonAsync
caught the exception. I don't actually understand how it did, as I
understand exception classification, it's the data type, not the way it
was thrown. One possibility is that the async exception may have been wrapped
in some other, non-async exception, and Show displayed it the same way.
This commit is contained in:
Joey Hess 2020-08-10 16:18:47 -04:00
parent 020e588262
commit c59a51a065
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 17 additions and 1 deletions

View file

@ -328,7 +328,7 @@ outputFilter cmd params environ outfilter errfilter =
-- maximum for them to finish and then cancel them.
-- (One program that has behaved this way in the past is
-- openssh.)
race_
void $ tryNonAsync $ race_
(wait outt >> wait errt)
(threadDelaySeconds (Seconds 2) >> cancel outt >> cancel errt)
return ret