From dd4d29582c35d720d1c81949c7e00bd751d6eaed Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sat, 6 Feb 2021 22:03:14 -0500 Subject: [PATCH] Terminate on fatal exception This retry loop is too naive for the current state of Cheogram. It is easy to create a situation where this gets into a retry spin because some thread is still holding on to the old connection to prosody but this is trying to restart said connection. If it gets so bad that exceptions are out here, just bail out and let monit restart us. --- Main.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Main.hs b/Main.hs index eb7fcc9..664747e 100644 --- a/Main.hs +++ b/Main.hs @@ -1972,10 +1972,8 @@ main = do } ) - forever $ do - log "" "runComponent STARTING" + log "" "runComponent STARTING" - (log "runComponent ENDED" <=< (runExceptT . syncIO)) $ - runComponent (Server componentJid host (PortNumber port)) secret - (component db redis (void . UIO.fromIO . StatsD.push statsd) backendHost did adhocBotIQReceiver (writeTChan adhocBotMessages) toRoomPresences toRejoinManager toJoinPartDebouncer sendToComponent toStanzaProcessor processDirectMessageRouteConfig jingleHandler componentJid [registrationJid] conferences) + log "runComponent ENDED" =<< runComponent (Server componentJid host (PortNumber port)) secret + (component db redis (void . UIO.fromIO . StatsD.push statsd) backendHost did adhocBotIQReceiver (writeTChan adhocBotMessages) toRoomPresences toRejoinManager toJoinPartDebouncer sendToComponent toStanzaProcessor processDirectMessageRouteConfig jingleHandler componentJid [registrationJid] conferences) _ -> log "ERROR" "Bad arguments" -- 2.34.5