Andrea Vezzosi pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • testsuite/tests/ghci/interp-cancellation/interp-concurrent.hs
    ... ... @@ -129,8 +129,8 @@ interpreterDies s = do
    129 129
     
    
    130 130
       signalProcess sigKILL pid
    
    131 131
       dR <- waiting "the statement thread to fail" (readMVar dRes)
    
    132
    -  check "a thread waiting on a dead interpreter gets PipeClosedException"
    
    133
    -        (isPipeClosed dR)
    
    132
    +  check "a thread waiting on a dead interpreter gets an exception"
    
    133
    +        (isLeft dR)
    
    134 134
       fR <- waiting "the splice thread to fail" (readMVar fRes)
    
    135 135
       check "a thread running a splice in a dead interpreter fails" (isLeft fR)
    
    136 136
     
    
    ... ... @@ -139,12 +139,13 @@ interpreterDies s = do
    139 139
       ex <- getProcessExitCode ph
    
    140 140
       check "its process is reaped" (isJust ex)
    
    141 141
     
    
    142
    -  r <- waiting "a request after the interpreter died"
    
    143
    -         (evalIn s "pure \"alive\" :: IO String")
    
    144
    -  check "the next request starts a new interpreter" (r == "alive")
    
    145
    -  ph' <- runningInterp s >>= maybe (failWith "no interpreter running") pure
    
    146
    -  pid' <- getPid ph'
    
    147
    -  check "the new interpreter is a different process" (pid' /= Just pid)
    
    142
    +  -- we don't restart the interp for now.
    
    143
    +  -- r <- waiting "a request after the interpreter died"
    
    144
    +  --        (evalIn s "pure \"alive\" :: IO String")
    
    145
    +  -- check "the next request starts a new interpreter" (r == "alive")
    
    146
    +  -- ph' <- runningInterp s >>= maybe (failWith "no interpreter running") pure
    
    147
    +  -- pid' <- getPid ph'
    
    148
    +  -- check "the new interpreter is a different process" (pid' /= Just pid)
    
    148 149
     
    
    149 150
     --------------------------------------------------------------------------------
    
    150 151
     -- Talking to the interpreter through the session
    
    ... ... @@ -181,7 +182,7 @@ runningInterp s = do
    181 182
       case interpInstance interp of
    
    182 183
         ExternalInterp (ExtIServ st) -> readMVar (interpStatus st) >>= \case
    
    183 184
           InterpRunning inst -> pure (Just (interpHandle (instProcess inst)))
    
    184
    -      InterpPending      -> pure Nothing
    
    185
    +      _                  -> pure Nothing
    
    185 186
         _ -> failWith "not using an external interpreter"
    
    186 187
     
    
    187 188
     --------------------------------------------------------------------------------
    

  • testsuite/tests/ghci/interp-cancellation/interp-concurrent.stdout
    ... ... @@ -6,9 +6,7 @@ ok: a running splice does not hold up other requests
    6 6
     ok: the thread running the splice is killed
    
    7 7
     ok: the splice is cancelled in the interpreter
    
    8 8
     ok: the interpreter still answers
    
    9
    -ok: a thread waiting on a dead interpreter gets PipeClosedException
    
    9
    +ok: a thread waiting on a dead interpreter gets an exception
    
    10 10
     ok: a thread running a splice in a dead interpreter fails
    
    11 11
     ok: the dead interpreter is stopped
    
    12 12
     ok: its process is reaped
    13
    -ok: the next request starts a new interpreter
    
    14
    -ok: the new interpreter is a different process