diff options
| author | 2026-02-21 19:55:48 +0800 | |
|---|---|---|
| committer | 2026-02-21 19:55:48 +0800 | |
| commit | 36bb351d73932b34709dc35ebe37f480b3a0a6fd (patch) | |
| tree | 380c50d703d8d3495c38c297f5d091135b784f0a /objectstore/packed | |
| parent | objectstore/packed: Optimize pack candidate lookup and locking (diff) | |
| signature | No signature | |
objectstore/packed: Best-effort touchCandidate
Diffstat (limited to 'objectstore/packed')
| -rw-r--r-- | objectstore/packed/idx_lookup_candidates.go | 5 |
1 files changed, 4 insertions, 1 deletions
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] |
