Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit d7ef640

Browse files
committed
Fix: fixed deadlock
1 parent dfc9a02 commit d7ef640

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: pkg/protocol/engine/blockdag/inmemoryblockdag/blockdag.go

-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ func (b *BlockDAG) setupBlock(block *blocks.Block) {
111111

112112
if unsolidParentsCount.Add(-1) == 0 {
113113
if block.SetSolid() {
114-
b.LogError("block solid", "blockID", block.ID())
115-
116114
b.events.BlockSolid.Trigger(block)
117115
}
118116
}

Diff for: pkg/protocol/protocol.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,13 @@ func (p *Protocol) initSubcomponents(networkEndpoint network.Endpoint) (shutdown
164164

165165
// initEviction initializes the eviction of old data when the engine advances and returns a function that shuts it down.
166166
func (p *Protocol) initEviction() (shutdown func()) {
167+
evictionWorker := p.Workers.CreatePool("Eviction").Start()
168+
167169
return p.Commitments.Root.OnUpdate(func(_ *Commitment, rootCommitment *Commitment) {
168170
if rootSlot := rootCommitment.Slot(); rootSlot > 0 {
169-
p.Evict(rootSlot - 1)
171+
evictionWorker.Submit(func() {
172+
p.Evict(rootSlot - 1)
173+
})
170174
}
171175
})
172176
}

0 commit comments

Comments
 (0)