packages feed

distributed-process 0.6.5 → 0.6.6

raw patch · 4 files changed

+31/−11 lines, 4 filesdep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: containers

API changes (from Hackage documentation)

- Control.Distributed.Process.Internal.BiMultiMap: lookup :: Ord a => a -> BiMultiMap a b v -> Set (b, v)
+ Control.Distributed.Process.Internal.BiMultiMap: lookupBy1st :: Ord a => a -> BiMultiMap a b v -> Set (b, v)
+ Control.Distributed.Process.Internal.BiMultiMap: lookupBy2nd :: Ord b => b -> BiMultiMap a b v -> Set (a, v)

Files

ChangeLog view
@@ -1,8 +1,12 @@+2016-10-13 Facundo Domínguez <facundo.dominguez@tweag.io> 0.6.6++* Remove monitors from remote nodes when a process dies. (#295)+ 2016-10-12 Facundo Domínguez <facundo.dominguez@tweag.io> 0.6.5  * Use only one connection to communicate between NCs. (#296, #297) * Improve documentation of CQueue.-* Implement bidirectional multimaps for links and monitors. (#293, #294, #295)+* Implement bidirectional multimaps for links and monitors. (#293, #294) * Fix various warnings. (#292) * Fix some of the intermittent failures in tests. * Improve error messages when node controllers receive invalid requests.
distributed-process.cabal view
@@ -1,5 +1,5 @@ Name:          distributed-process-Version:       0.6.5+Version:       0.6.6 Cabal-Version: >=1.8 Build-Type:    Simple License:       BSD3
src/Control/Distributed/Process/Internal/BiMultiMap.hs view
@@ -5,7 +5,8 @@   , singleton   , size   , insert-  , lookup+  , lookupBy1st+  , lookupBy2nd   , delete   , deleteAllBy1st   , deleteAllBy2nd@@ -62,10 +63,12 @@                                r)  -- | Looks up all the triplets whose first component is the given value.------ See 'flip' in order to look up by the second component.-lookup :: Ord a => a -> BiMultiMap a b v -> Set (b, v)-lookup a (BiMultiMap m _) = maybe Set.empty id $ Map.lookup a m+lookupBy1st :: Ord a => a -> BiMultiMap a b v -> Set (b, v)+lookupBy1st a (BiMultiMap m _) = maybe Set.empty id $ Map.lookup a m++-- | Looks up all the triplets whose second component is the given value.+lookupBy2nd :: Ord b => b -> BiMultiMap a b v -> Set (a, v)+lookupBy2nd b = lookupBy1st b . flip  -- | Deletes a triplet. It yields the original multimap if the triplet is -- not present.
src/Control/Distributed/Process/Node.hs view
@@ -45,6 +45,7 @@   , map   , member   , toList+  , union   ) import Data.Foldable (forM_) import Data.List (foldl')@@ -879,6 +880,18 @@       when (localOnly <= isLocal node (ProcessIdentifier us)) $         notifyDied us them reason (Just ref) +  -- Notify remote nodes that the process died so it can be removed from monitor+  -- lists.+  mapM_ (forwardDeath node) $+    [ nid | ProcessIdentifier pid <- [ident]+          , i <- Set.toList $ Set.union+             (Set.map fst $ BiMultiMap.lookupBy2nd pid unaffectedLinks)+             (Set.map fst $ BiMultiMap.lookupBy2nd pid unaffectedMons)+          , let nid = nodeOf i+          , nid /= localNodeId node+    ]++  -- Delete monitors in the local node.   let deleteDeads :: (Ord a, Ord v)                   => BiMultiMap a ProcessId v -> BiMultiMap a ProcessId v       deleteDeads = case ident of@@ -899,12 +912,12 @@            True ->               do forM_ nidlist $ \(nid,_) ->                    when (not $ isLocal node (NodeIdentifier nid))-                      (forwardNameDeath node nid)+                      (forwardDeath node nid)                  return Nothing            False -> return $ Just (pid,nidlist)  )   modify' $ registeredOnNodes ^= (Map.fromList (catMaybes remaining))     where-       forwardNameDeath node nid = ncSendToNode nid+       forwardDeath node nid = ncSendToNode nid            NCMsg { ctrlMsgSender = NodeIdentifier (localNodeId node)                  , ctrlMsgSignal = Died ident reason                  }@@ -1059,9 +1072,9 @@     Nothing   -> dispatch (isLocal node (ProcessIdentifier from))                           from (ProcessInfoNone DiedUnknownId)     Just proc    -> do-      itsLinks    <- Set.map fst . BiMultiMap.lookup them <$>+      itsLinks    <- Set.map fst . BiMultiMap.lookupBy1st them <$>                        gets (^. links)-      itsMons     <- BiMultiMap.lookup them <$> gets (^. monitors)+      itsMons     <- BiMultiMap.lookupBy1st them <$> gets (^. monitors)       registered  <- gets (^. registeredHere)       size        <- liftIO $ queueSize $ processQueue $ proc