Skip to content

Commit 9e4bb74

Browse files
committed
Log locks to try narrow down cache issues
1 parent 7e5aada commit 9e4bb74

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

builder/src/Stuff.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{-# OPTIONS_GHC -Wall #-}
2+
{-# LANGUAGE BangPatterns #-}
3+
24
module Stuff
35
( details
46
, interfaces
@@ -131,6 +133,12 @@ withRootLock root work =
131133
do let dir = stuff root
132134
Dir.createDirectoryIfMissing True dir
133135
Lock.withFileLock (dir </> "lock") Lock.Exclusive (\_ -> work)
136+
& Lamdera.alternativeImplementation (do
137+
Lamdera.debug "🔒 withRootLock"
138+
!res <- Lock.withFileLock (dir </> "lock") Lock.Exclusive (\_ -> work)
139+
Lamdera.debug "🔓 unlocking withRootLock"
140+
pure res
141+
)
134142

135143

136144
withRegistryLock :: PackageCache -> IO a -> IO a

ext-common/Ext/Common.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ killTrackedThreads = do
359359
debug $ "No tracked GHCI threads to kill."
360360
pure []
361361
threads -> do
362-
debug $ "Killing tracked GHCI threads: " ++ show threads
362+
debug $ "🔪 Killing tracked GHCI threads: " ++ show threads
363363
mapM killThread threads
364364
pure []
365365
)

0 commit comments

Comments
 (0)