Skip to content

Off-stack error when running parallel action in same execution context #156

@felixSchl

Description

@felixSchl
fiber <- fork do
  r <- try do
    -- delay $ 0.0 # Milliseconds -- uncomment this line and it will work
    -- OR remove the 'sequential $ parallel' part below and it will also work
    sequential $ parallel $ throwError $ error "boom"
  traceM r
liftAff $ killFiber (error "killit") fiber -- this causes the off-stack error
liftAff $ delay $ 1000.0 # Milliseconds -- required to see off-stack error

So, for some reason, when killing a fiber that has thrown an error inside a parallel action (and executed via sequential) that is immune to errors via try, the killing of the fiber causes an off-stack error to be produced. Breaking the execution context using delay will have the error go away. Similarly, not using sequential $ parallel at all will also make the error go away. Note that the error only surfaces when killing the fiber, and that you have to wait a little before the program terminates to witness the off-stack error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions