Skip to content

Commit 1d92f82

Browse files
committed
Don't swallow async cancel exceptions
1 parent 08aa58d commit 1d92f82

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ghcide-test/exe/ShakeRestartTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tests = testGroup "shake restart merging"
3636
merged = mergePendingRestart p1 (Just p2)
3737

3838
pendingRestartReasons merged @?= ["r1", "r2"]
39-
keys <- sequence $ pendingRestartActionBetweenSessions merged
39+
keys <- sequence $ reverse $ pendingRestartActionBetweenSessions merged
4040
concat keys @?= [key2, key1]
4141

4242
, testCase "RestartSlot coalescing" $ do

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,9 @@ withRestartWorker ide@IdeState{..} action =
889889
withAsync (forever $
890890
processPendingRestart (shakeRecorder shakeExtras) ide
891891
`catch` \(e :: SomeException) ->
892-
logWith (shakeRecorder shakeExtras) Error (LogRestartWorkerException e)) $
892+
case fromException e of
893+
Just AsyncCancelled -> throwIO e
894+
_ -> logWith (shakeRecorder shakeExtras) Error (LogRestartWorkerException e)) $
893895
\_ -> action
894896

895897
processPendingRestart :: Recorder (WithPriority Log) -> IdeState -> IO ()

0 commit comments

Comments
 (0)