-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Description
Hey, I've been running into issues with fork cancellation and supervisors and decided to spend some time narrowing the issue down. Below are two snippets highlighting what I would consider strange behaviour. It's not obvious to me why this behaviour occurs and looks like a bug on the surface.
The following snippet throws off-stack, due to:
https://github.com/slamdata/purescript-aff/blob/3457df9993a78e408ed56f0bb619941911d375d0/src/Control/Monad/Aff.js#L500-L505
outer <- forkAff do
bracket
(pure unit)
(const $ pure unit)
\_ -> supervise do
fiber <- forkAff $ supervise $ supervise do -- notice the double 'supervise'
delay $ 10.0 # Milliseconds
joinFiber fiber
killFiber (error "done") outer
delay $ 100.0 # Milliseconds
and this blocks forever:
outer <- forkAff do
bracket
(pure unit)
(const $ pure unit)
\_ -> supervise do
fiber <- forkAff $ supervise do
delay $ 10.0 # Milliseconds
joinFiber fiber
killFiber (error "doen") outer
delay $ 100.0 # Milliseconds
You can play around with these, but from my observations this only happens when inside a bracket
, but the problem is probably broader.
Metadata
Metadata
Assignees
Labels
No labels