Skip to content

Commit b62fe1f

Browse files
committed
add logging to ChildInitFailure handler
ChildInitFailure's were being handled in a way that prevented logFailure from being called appropriately. This affected tryChildStart and the spawnIt helper used in the StarterProcess variants of ToChildStart.
1 parent 91eaf35 commit b62fe1f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,13 @@ filterInitFailures :: ProcessId
16331633
-> Process ()
16341634
filterInitFailures sup pid ex = do
16351635
case ex of
1636-
ChildInitFailure _ -> liftIO $ throwIO ex
1636+
ChildInitFailure _ -> do
1637+
-- This is used as a `catches` handler in multiple places
1638+
-- and matches first before the other handlers that
1639+
-- would call logFailure.
1640+
-- We log here to avoid silent failure in those cases.
1641+
logEntry Log.error $ mkReport "ChildInitFailure" sup (show pid) (show ex)
1642+
liftIO $ throwIO ex
16371643
ChildInitIgnore -> Unsafe.cast sup $ IgnoreChildReq pid
16381644

16391645
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)