@@ -339,10 +339,8 @@ nodeController = forever $ do
339339
340340 -- Forward the message if appropriate
341341 case destNid (ctrlMsgSignal msg) of
342− Just nid' | nid' /= localNodeId node ->
343− ctrlSendTo (Right nid') . BSL.toChunks . encode $ msg
344− _ ->
345− return ()
342+ Just nid' | nid' /= localNodeId node -> ncSendCtrlMsg nid' msg
343+ _ -> return ()
346344
347345 processCtrlMsg msg
348346
@@ -365,6 +363,9 @@ ctrlSendTo them payload = do
365363 , ctrlMsgSignal = Died them DiedDisconnect
366364 }
367365
366+ncSendCtrlMsg :: NodeId -> NodeCtrlMsg -> NodeCtrl ()
367+ncSendCtrlMsg dest = ctrlSendTo (Right dest) . BSL.toChunks . encode
368+
368369ctrlSendLocal :: LocalProcessId -> Message -> NodeCtrl ()
369370ctrlSendLocal lpid msg = do
370371 node <- ask
@@ -425,6 +426,11 @@ processCtrlMsg (NodeCtrlMsg (Left from) (Monitor them ref)) = do
425426 (False, True) -> -- [Unified: second rule]
426427 ctrlSendLocal (processLocalId from) . createMessage $
427428 ProcessDied ref them DiedNoProc
429+ (False, False) -> -- [Unified: third rule]
430+ ncSendCtrlMsg (processNodeId from) $ NodeCtrlMsg
431+ { ctrlMsgSender = Right (localNodeId node)
432+ , ctrlMsgSignal = Died (Left them) DiedNoProc
433+ }
428434
429435processCtrlMsg (NodeCtrlMsg (Right _) (Monitor _ _)) =
430436 error "Monitor message from a node?"
@@ -466,11 +472,10 @@ processCtrlMsg (NodeCtrlMsg _from (Died (Left pid) reason)) = do
466472 then
467473 ctrlSendLocal (processLocalId us) msg
468474 else
469− ctrlSendTo (Right . processNodeId $ us) . BSL.toChunks . encode $
470− NodeCtrlMsg
471− { ctrlMsgSender = Right (localNodeId node) -- TODO: why the change in sender? How does that affect 'reconnect' semantics?
472− , ctrlMsgSignal = Died (Left pid) reason
473− }
475+ ncSendCtrlMsg (processNodeId us) $ NodeCtrlMsg
476+ { ctrlMsgSender = Right (localNodeId node) -- TODO: why the change in sender? How does that affect 'reconnect' semantics?
477+ , ctrlMsgSignal = Died (Left pid) reason
478+ }
474479
475480 modify $ (nodeCtrlLinksForProcess pid ^= Set.empty)
476481 . (nodeCtrlMonsForProcess pid ^= Map.empty)