Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supervised forks do not rethrow exceptions when joined #140

Open
felixSchl opened this issue Mar 15, 2018 · 0 comments
Open

Supervised forks do not rethrow exceptions when joined #140

felixSchl opened this issue Mar 15, 2018 · 0 comments

Comments

@felixSchl
Copy link

main :: Eff _ Unit
main = void $ launchAff do
 fiber <- forkAff $ do
   mainT <- forkAff $ supervise do

     traceAnyA "tick 1"
     delay $ 1000.0 # Milliseconds

     traceAnyA "tick 2"
     delay $ 1000.0 # Milliseconds

     void $ liftEff (throwException (error "die"))

     traceAnyA "tick 3"
     delay $ 1000.0 # Milliseconds

     traceAnyA "tick 4"
     delay $ 1000.0 # Milliseconds

   void $ joinFiber mainT
   traceAnyA "done"
 void $ joinFiber fiber
 traceAnyA "done 1"

This program produces the following output:

> pulp run
tick 1
tick 2
>

The thrown exception does not get rethrown when trying to joinFiber mainT or joinFiber fiber and the program just peacefully terminates. Expected it to rethrow the exception as soon as I joinFiber the offending fiber.

This behaviour does not occur when mainT is not supervised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant