Make server process killable

35163c3c18
introduced a new use of `mask` which makes the server process uninterruptible
while waiting for a new incoming request.  This change fixes that by
surrounding the logic that waits for a new request with `unmask`.  This
new `unmask` should still respect the finalization guarantees of the
surrounding masked code.
This commit is contained in:
Gabriel Gonzalez 2020-05-27 16:45:37 -07:00
parent 595cb6a3bf
commit d4a80a9a4e
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ withServerCallAsync :: Server
-> (ServerCall -> IO ())
-> IO ()
withServerCallAsync s f = mask $ \unmask ->
serverCreateCall s >>= \case
unmask (serverCreateCall s) >>= \case
Left e -> do grpcDebug $ "withServerCallAsync: call error: " ++ show e
return ()
Right c -> do wasForkSuccess <- forkServer s handler