ndmitchell / ndmitchell/hlint

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

Open
#1,663 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.6k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/haskell/haskell-language-server/issues/4718#issue-3370604152

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the top-level mode :: Mode (CmdArgs Cmd) initialization in HLint and trace its unsafePerformIO usage. Use the linked HLS issue and the described old/new Shake-session scenario as reproduction context. Done means an asynchronous cancellation from an old session is not retained by later accesses to mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.