Skip to content

[DP-101] Possibly incorrect monitor behavior #211

Open
@qnikst

Description

@qnikst

[Imported from JIRA. Reported by Facundo Dominguez @facundominguez) as DP-101 on 2015-02-09 20:22:23]
The following program blocks because the expected ProcessMonitorNotification never arrives, but a monitor notification would be expected according to the semantic notes.

Tested with runhaskell monitorTest.hs

import Control.Distributed.Process
import Control.Distributed.Process.Node
import Network.Transport.TCP
import qualified Network.Socket as N

main :: IO ()
main = do
  Right (transport, internals) <- createTransportExposeInternals "127.0.0.1" "8080" defaultTCPParameters
  lnode0 <- newLocalNode transport initRemoteTable
  lnode1 <- newLocalNode transport initRemoteTable
  runProcess lnode0 $ do
    self <- getSelfPid
    liftIO $ runProcess lnode1 $ do
      send self ()
      liftIO $ N.close =<< socketBetween internals (nodeAddress $ localNodeId lnode0)
                                                   (nodeAddress $ localNodeId lnode1)
      send self ()
      -- removing this timeout has the test complete
      receiveTimeout 100000 [] :: Process (Maybe ())
      monitor self
      ProcessMonitorNotification _ _ _ <- expect
      liftIO $ putStrLn "SUCCESS!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions