From 0fd7a61f7fe414c5ffedf2f72ec1052a9a490e36 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Fri, 20 Mar 2026 09:47:09 +0800 Subject: [PATCH] triedb/pathdb: ignore pruning signal during index initialization --- triedb/pathdb/history_indexer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/triedb/pathdb/history_indexer.go b/triedb/pathdb/history_indexer.go index d8c3b3b12f..ea03f82edb 100644 --- a/triedb/pathdb/history_indexer.go +++ b/triedb/pathdb/history_indexer.go @@ -831,7 +831,14 @@ func (i *historyIndexer) shorten(historyID uint64) error { // prune signals the pruner that the history tail has advanced to the given ID, // so that stale index blocks referencing pruned histories can be removed. func (i *historyIndexer) prune(newTail uint64) { - i.pruner.prune(newTail) + select { + case <-i.initer.closed: + log.Debug("Ignored the pruning signal", "reason", "closed") + case <-i.initer.done: + i.pruner.prune(newTail) + default: + log.Debug("Ignored the pruning signal", "reason", "busy") + } } // progress returns the indexing progress made so far. It provides the number