| ... |
... |
@@ -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
|
--------------------------------------------------------------------------------
|