Andrea Vezzosi pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC Commits: a540b492 by Andrea Vezzosi at 2026-11-30T22:37:34+01:00 fixup! interp: print exit code if non-zero when iserv terminates - - - - - 2 changed files: - testsuite/tests/ghci/interp-cancellation/interp-concurrent.hs - testsuite/tests/ghci/interp-cancellation/interp-concurrent.stdout Changes: ===================================== testsuite/tests/ghci/interp-cancellation/interp-concurrent.hs ===================================== @@ -129,8 +129,8 @@ interpreterDies s = do signalProcess sigKILL pid dR <- waiting "the statement thread to fail" (readMVar dRes) - check "a thread waiting on a dead interpreter gets PipeClosedException" - (isPipeClosed dR) + check "a thread waiting on a dead interpreter gets an exception" + (isLeft dR) fR <- waiting "the splice thread to fail" (readMVar fRes) check "a thread running a splice in a dead interpreter fails" (isLeft fR) @@ -139,12 +139,13 @@ interpreterDies s = do ex <- getProcessExitCode ph check "its process is reaped" (isJust ex) - r <- waiting "a request after the interpreter died" - (evalIn s "pure \"alive\" :: IO String") - check "the next request starts a new interpreter" (r == "alive") - ph' <- runningInterp s >>= maybe (failWith "no interpreter running") pure - pid' <- getPid ph' - check "the new interpreter is a different process" (pid' /= Just pid) + -- we don't restart the interp for now. + -- r <- waiting "a request after the interpreter died" + -- (evalIn s "pure \"alive\" :: IO String") + -- check "the next request starts a new interpreter" (r == "alive") + -- ph' <- runningInterp s >>= maybe (failWith "no interpreter running") pure + -- pid' <- getPid ph' + -- check "the new interpreter is a different process" (pid' /= Just pid) -------------------------------------------------------------------------------- -- Talking to the interpreter through the session @@ -181,7 +182,7 @@ runningInterp s = do case interpInstance interp of ExternalInterp (ExtIServ st) -> readMVar (interpStatus st) >>= \case InterpRunning inst -> pure (Just (interpHandle (instProcess inst))) - InterpPending -> pure Nothing + _ -> pure Nothing _ -> failWith "not using an external interpreter" -------------------------------------------------------------------------------- ===================================== testsuite/tests/ghci/interp-cancellation/interp-concurrent.stdout ===================================== @@ -6,9 +6,7 @@ ok: a running splice does not hold up other requests ok: the thread running the splice is killed ok: the splice is cancelled in the interpreter ok: the interpreter still answers -ok: a thread waiting on a dead interpreter gets PipeClosedException +ok: a thread waiting on a dead interpreter gets an exception ok: a thread running a splice in a dead interpreter fails ok: the dead interpreter is stopped ok: its process is reaped -ok: the next request starts a new interpreter -ok: the new interpreter is a different process View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a540b492d7760d6483aa06fcb6b13397... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a540b492d7760d6483aa06fcb6b13397... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help