Skip to content

Commit

Permalink
fix reversed if case + comment in doRestartChild
Browse files Browse the repository at this point in the history
  • Loading branch information
tavisrudd committed Apr 25, 2014
1 parent 365c517 commit 6656a92
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Control/Distributed/Process/Platform/Supervisor.hs
Expand Up @@ -1174,20 +1174,18 @@ doRestartChild _ spec _ state = do -- TODO: use ProcessId and DiedReason to log
-- BadClosure and UnresolvableAddress from the StarterProcess
-- variants of ChildStart, which both come back from
-- doStartChild as (Left err).
-- Since we cannot recover from that, there's no point in trying
-- to start this child again (as the closure will never resolve),
-- so we remove the child forthwith.
sup <- getSelfPid
logEntry Log.error $
mkReport "Unrecoverable error in child" sup (childKey spec) (show err)
if (isTemporary (childRestart spec))
-- TODO: convert this to a meaningful exception type
then die $ "Unrecoverable error in child " ++ (childKey spec)
else return $ ( (active ^: Map.filter (/= chKey))
if isTemporary (childRestart spec)
then return $ ( (active ^: Map.filter (/= chKey))
. (bumpStats Active chType decrement)
. (bumpStats Specified chType decrement)
$ removeChild spec st
)
else die $ "Unrecoverable error in child " ++ (childKey spec)
-- TODO: convert this to a meaningful exception type

where
chKey = childKey spec
chType = childType spec
Expand Down

0 comments on commit 6656a92

Please sign in to comment.