You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be related to #38 (or a duplicate of it), but I am posting because my use case is explicitly using async exceptions.
Here is a simple program that calls readProcess_ and then attempts to cancel it, using the async library:
importControl.ConcurrentimportControl.Concurrent.AsyncimportControl.ExceptionimportSystem.Process.Typedmain::IO()
main =doputStrLn"Start"
a <- async $do
readProcess_ (proc"/bin/sleep" ["1"]) -- Sleep 1 second
threadDelay (20*1000) -- Wait 20 millisecondsputStrLn"Canceling"
cancel a
putStrLn"Waiting"
r <- waitCatch a
print r
Here is the correct output that I expect to see (and I get about 20% of the time):
Start
Canceling
Left AsyncCancelled
But most of the time, I get this unexpected output:
Start
Canceling
Left waitForProcess: does not exist (No child processes)
That is the first bug.
The second bug is that the "cancel" line is not immediate, it seems that it doesn't actually terminate the running process, but always waits for the "sleep" process to complete (I am compiling using -threaded flag). This delay happens with both output scenarios.
Thank you
The text was updated successfully, but these errors were encountered:
This may be related to #38 (or a duplicate of it), but I am posting because my use case is explicitly using async exceptions.
Here is a simple program that calls readProcess_ and then attempts to cancel it, using the async library:
Here is the correct output that I expect to see (and I get about 20% of the time):
But most of the time, I get this unexpected output:
That is the first bug.
The second bug is that the "cancel" line is not immediate, it seems that it doesn't actually terminate the running process, but always waits for the "sleep" process to complete (I am compiling using
-threaded
flag). This delay happens with both output scenarios.Thank you
The text was updated successfully, but these errors were encountered: