Skip to content

Commit 6656a92

Browse files
committed
fix reversed if case + comment in doRestartChild
1 parent 365c517 commit 6656a92

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Control/Distributed/Process/Platform/Supervisor.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,20 +1174,18 @@ doRestartChild _ spec _ state = do -- TODO: use ProcessId and DiedReason to log
11741174
-- BadClosure and UnresolvableAddress from the StarterProcess
11751175
-- variants of ChildStart, which both come back from
11761176
-- doStartChild as (Left err).
1177-
-- Since we cannot recover from that, there's no point in trying
1178-
-- to start this child again (as the closure will never resolve),
1179-
-- so we remove the child forthwith.
11801177
sup <- getSelfPid
11811178
logEntry Log.error $
11821179
mkReport "Unrecoverable error in child" sup (childKey spec) (show err)
1183-
if (isTemporary (childRestart spec))
1184-
-- TODO: convert this to a meaningful exception type
1185-
then die $ "Unrecoverable error in child " ++ (childKey spec)
1186-
else return $ ( (active ^: Map.filter (/= chKey))
1180+
if isTemporary (childRestart spec)
1181+
then return $ ( (active ^: Map.filter (/= chKey))
11871182
. (bumpStats Active chType decrement)
11881183
. (bumpStats Specified chType decrement)
11891184
$ removeChild spec st
11901185
)
1186+
else die $ "Unrecoverable error in child " ++ (childKey spec)
1187+
-- TODO: convert this to a meaningful exception type
1188+
11911189
where
11921190
chKey = childKey spec
11931191
chType = childType spec

0 commit comments

Comments
 (0)