Skip to content

Commit

Permalink
Make server process killable (#105)
Browse files Browse the repository at this point in the history
35163c3 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.
  • Loading branch information
Gabriella439 authored May 28, 2020
1 parent 595cb6a commit d532cec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/Network/GRPC/LowLevel/Server/Unregistered.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d532cec

Please sign in to comment.