From 36bb351d73932b34709dc35ebe37f480b3a0a6fd Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 19:55:48 +0800 Subject: objectstore/packed: Best-effort touchCandidate --- objectstore/packed/idx_lookup_candidates.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'objectstore') diff --git a/objectstore/packed/idx_lookup_candidates.go b/objectstore/packed/idx_lookup_candidates.go index 23ac9a61..83055aac 100644 --- a/objectstore/packed/idx_lookup_candidates.go +++ b/objectstore/packed/idx_lookup_candidates.go @@ -124,8 +124,11 @@ func (store *Store) discoverCandidates() ([]packCandidate, error) { } // touchCandidate moves one candidate to the front of the lookup order. +// This is done on a best-effort basis. func (store *Store) touchCandidate(packName string) { - store.candidatesMu.Lock() + if !store.candidatesMu.TryLock() { + return + } defer store.candidatesMu.Unlock() node := store.candidateNodeByPack[packName] -- cgit v1.3.1-10-gc9f91