Skip to content

mode :: Mode (CmdArgs Cmd) memoizes async exceptions, breaking HLS Shake restarts #1663

@soulomoon

Description

@soulomoon

The top-level mode :: Mode (CmdArgs Cmd) in HLint is initialized using unsafePerformIO. If an asynchronous exception occurs during this initialization, the exception is captured and memoized in the CAF. As a result, every subsequent access to mode rethrows the same async exception.

In practice, this causes HLS to retain the cancel exception from an old Shake session and propagate it into the new session, immediately killing it.

See haskell/haskell-language-server#4718 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions