Skip to content

Commit 5ce9b14

Browse files
committed
Release the forker initial key
1 parent 4a1ea5f commit 5ce9b14

File tree

2 files changed

+5
-1
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB

2 files changed

+5
-1
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ newForker h ldbEnv rr (st, rk) = do
781781
, foeSwitchVar = ldbSeq ldbEnv
782782
, foeTracer = tr
783783
, foeResourcesToRelease = (ldbOpenHandlesLock ldbEnv, k, toRelease)
784+
, foeInitialHandleKey = rk
784785
}
785786
atomically $ modifyTVar (ldbForkers ldbEnv) $ Map.insert forkerKey forkerEnv
786787
pure $

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Forker.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Ouroboros.Consensus.Storage.LedgerDB.V2.Forker
1919
, module Ouroboros.Consensus.Storage.LedgerDB.Forker
2020
) where
2121

22+
import qualified Control.Monad as Monad
2223
import Control.RAWLock hiding (read)
2324
import Control.ResourceRegistry
2425
import Control.Tracer
@@ -52,6 +53,7 @@ data ForkerEnv m l blk = ForkerEnv
5253
-- ^ Config
5354
, foeResourcesToRelease :: !(RAWLock m (), ResourceKey m, StrictTVar m (m ()))
5455
-- ^ Release the resources
56+
, foeInitialHandleKey :: !(ResourceKey m)
5557
}
5658
deriving Generic
5759

@@ -172,7 +174,7 @@ implForkerCommit env = do
172174
--
173175
-- The rest of the states in the forker will be closed via
174176
-- @foeResourcesToRelease@ instead of via the registry.
175-
close $ tables $ AS.anchor lseq
177+
Monad.void $ release foeInitialHandleKey
176178
pure (closeDiscarded, LedgerSeq newdb)
177179
)
178180

@@ -186,6 +188,7 @@ implForkerCommit env = do
186188
{ foeLedgerSeq
187189
, foeSwitchVar
188190
, foeResourcesToRelease
191+
, foeInitialHandleKey
189192
} = env
190193

191194
theImpossible =

0 commit comments

Comments
 (0)