@@ -198,6 +198,9 @@ data Log
198198 -- * OfInterest Log messages
199199 | LogSetFilesOfInterest ! [(NormalizedFilePath , FileOfInterestStatus )]
200200 | LogTimeOutShuttingDownWaitForSessionVar ! Seconds
201+ | LogShakeShutProcess ! ShutStage
202+ deriving Show
203+ data ShutStage = ShutSessionCanceled | ShutProfiledDone | ShutProgressMonitorStop | ShutProgressStop | ShutSessionGet
201204 deriving Show
202205
203206instance Pretty Log where
@@ -242,7 +245,7 @@ instance Pretty Log where
242245 " Set files of interst to" <> Pretty. line
243246 <> indent 4 (pretty $ fmap (first fromNormalizedFilePath) ofInterest)
244247 LogTimeOutShuttingDownWaitForSessionVar seconds ->
245- " Timed out waiting for session var after" <+> pretty seconds <+> " seconds"
248+ " ShutWaitFor session timed out waiting for session var after" <+> pretty seconds <+> " seconds"
246249
247250-- | We need to serialize writes to the database, so we send any function that
248251-- needs to write to the database over the channel, where it will be picked up by
@@ -732,15 +735,19 @@ shakeShut recorder IdeState{..} = do
732735 res <- timeout 1 $ withMVar shakeSession $ \ runner -> do
733736 -- Shake gets unhappy if you try to close when there is a running
734737 -- request so we first abort that.
738+ logWith recorder Warning $ LogShakeShutProcess ShutSessionGet
735739 cancelShakeSession runner
740+ logWith recorder Warning $ LogShakeShutProcess ShutSessionCanceled
736741 void $ shakeDatabaseProfile shakeDb
742+ logWith recorder Warning $ LogShakeShutProcess ShutProfiledDone
737743 -- might hang if there are still running
738744 progressStop $ progress shakeExtras
745+ logWith recorder Warning $ LogShakeShutProcess ShutProgressStop
739746 stopMonitoring
747+ logWith recorder Warning $ LogShakeShutProcess ShutProgressMonitorStop
740748 case res of
741- Nothing -> do
749+ Nothing ->
742750 logWith recorder Error $ LogTimeOutShuttingDownWaitForSessionVar 1
743- stopMonitoring
744751 Just _ -> pure ()
745752
746753-- | This is a variant of withMVar where the first argument is run unmasked and if it throws
0 commit comments