@@ -25,13 +25,18 @@ import Control.Concurrent.MVar
26import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
26import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
27import Control.Exception (SomeException, throwIO, ErrorCall(..))
27import Control.Exception (SomeException, throwIO, ErrorCall(..))
28−import qualified Control.Exception as Ex (catch)
28+import Control.Monad.Catch (try, catch, finally, mask, onException)
29−import Control.Applicative ((<$>), (<*>), pure, (<|>))
29+import Control.Applicative ((<|>))
30import qualified Network.Transport as NT (closeEndPoint, EndPointAddress)
30import qualified Network.Transport as NT (closeEndPoint, EndPointAddress)
31−import Control.Distributed.Process
31+import Control.Distributed.Process hiding
32import Control.Distributed.Process.Internal.Types
38import Control.Distributed.Process.Internal.Types
33− ( NodeId(nodeAddress)
34− , LocalNode(localEndPoint)
39+ ( LocalNode(localEndPoint)
35 , ProcessExitException(..)
40 , ProcessExitException(..)
36 , nullProcessId
41 , nullProcessId
37 , createUnencodedMessage
42 , createUnencodedMessage
@@ -65,7 +70,7 @@ expectThat a matcher = case res of
65forkTry :: IO () -> IO ThreadId
70forkTry :: IO () -> IO ThreadId
66forkTry p = do
71forkTry p = do
67 tid <- myThreadId
72 tid <- myThreadId
68− forkIO $ Ex.catch p (\e -> throwTo tid (e :: SomeException))
73+ forkIO $ catch p (\e -> throwTo tid (e :: SomeException))
70-- | The ping server from the paper
75-- | The ping server from the paper
71ping :: Process ()
76ping :: Process ()
@@ -700,8 +705,8 @@ testRemoteRegistry TestTransport{..} = do
700 (\(RegisterReply _ _ _) -> return ()) ]
705 (\(RegisterReply _ _ _) -> return ()) ]
701 registerRemoteAsync nid1 "ping" deadProcess
706 registerRemoteAsync nid1 "ping" deadProcess
702 receiveWait [
707 receiveWait [
703− matchIf (\(RegisterReply label' False (Just pid)) ->
708+ matchIf (\(RegisterReply label' False (Just pid'')) ->
704− "ping" == label' && pid == pingServer)
709+ "ping" == label' && pid'' == pingServer)
705 (\(RegisterReply _ _ _) -> return ()) ]
710 (\(RegisterReply _ _ _) -> return ()) ]
706 unregisterRemoteAsync nid1 "dead"
711 unregisterRemoteAsync nid1 "dead"
707 receiveWait [
712 receiveWait [