Skip to content

Commit 4024ce6

Browse files
committed
Label lockfile thread
1 parent 1c7dd6e commit 4024ce6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Patch
2+
3+
- Label the DbLock acquisition thread.

ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node/DbLock.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Ouroboros.Consensus.Node.DbLock (
1212
, withLockDB_
1313
) where
1414

15+
import Control.Monad.Class.MonadFork
1516
import Control.Monad.Class.MonadTimer.SI
1617
import qualified Data.Time.Clock as Time
1718
import Ouroboros.Consensus.Util.FileLock
@@ -70,7 +71,9 @@ withLockDB_ fileLock mountPoint lockFsPath lockTimeout action =
7071
-- lock, the whole process will soon die.
7172
acquireLock :: m (m ())
7273
acquireLock = do
73-
lockFileAsync <- async (lockFile fileLock lockFilePath)
74+
lockFileAsync <- async (do
75+
labelThisThread "ChainDB lock"
76+
lockFile fileLock lockFilePath)
7477
timeout lockTimeout (wait lockFileAsync) >>= \case
7578
-- We timed out while waiting on the lock. The db is still locked.
7679
Nothing -> throwIO $ DbLocked lockFilePath

0 commit comments

Comments
 (0)