Closed istathar closed 1 year ago
I'm trying to simulate the advertised behaviour that
If an asynchronous exception is thrown to the thread executing
callProcess
, the forked process will be terminated andcallProcess
will wait (block) until the process has been terminated.
but I haven't managed to see that actually happen yet. Like, it's blocking (something is?) but the child isn't terminating?
This has also cleaned up the behaviour of cancelThread
a touch. So many corner cases.
The process library offers cleanupProcess
, https://hackage.haskell.org/package/process-1.6.17.0/docs/System-Process.html#v:cleanupProcess. I don't know if there's any particular advantage to calling that; reading the code there they've covered off a few cases but I suspect what would be better is us directly sending SIGTERM and a bit later SIGKILL ourselves rather than relying on terminateProcess
(which only sends SIGTERM).
(that can happen in another PR, potentially)
A variant of
readProcess
(which gets the child's output) iscallProcess
, which just runs a child and waits for it to finish. This branch adds a wrapper around that function.