From d0bfac6d5e130e6f9e1f97c873ad3ca404c3c2fd Mon Sep 17 00:00:00 2001 From: Keran Yang Date: Mon, 31 Jul 2023 12:56:34 -0400 Subject: [PATCH] fix: avoid potential deadlocks when operating UniqueStringList (#905) Fixes #863 Signed-off-by: Keran Yang --- pkg/daemon/server/service/rater/uniq_str_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/daemon/server/service/rater/uniq_str_list.go b/pkg/daemon/server/service/rater/uniq_str_list.go index 599feff992..2131c5107e 100644 --- a/pkg/daemon/server/service/rater/uniq_str_list.go +++ b/pkg/daemon/server/service/rater/uniq_str_list.go @@ -59,7 +59,7 @@ func (l *UniqueStringList) MoveToBack(value string) { func (l *UniqueStringList) Front() string { l.lock.RLock() defer l.lock.RUnlock() - if l.Length() == 0 { + if l.l.Len() == 0 { return "" } return l.l.Front().Value.(string)