diff --git a/container/queue/priority_queue.go b/container/queue/priority_queue.go index e4629026a2..9a240c43bc 100644 --- a/container/queue/priority_queue.go +++ b/container/queue/priority_queue.go @@ -152,8 +152,8 @@ func (pq *PriorityQueue) PopByKey(key string) (*Item, error) { // RetrieveByKey searches the queue for an item with the given key and returns it // from the queue if found. Returns nil if not found. func (pq *PriorityQueue) RetrieveByKey(key string) *Item { - pq.lock.Lock() - defer pq.lock.Unlock() + pq.lock.RLock() + defer pq.lock.RUnlock() item, ok := pq.dataMap[key] if !ok {