Fix data race of timerecord (#23524)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/23530/head
yah01 2023-04-19 14:18:30 +08:00 committed by GitHub
parent e9dcba3050
commit c7c89511b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -45,9 +45,9 @@ func NewScheduler() *Scheduler {
func (s *Scheduler) Add(task Task) bool {
switch t := task.(type) {
case *SearchTask:
t.tr.RecordSpan()
select {
case s.searchWaitQueue <- t:
t.tr.RecordSpan()
metrics.QueryNodeReadTaskUnsolveLen.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Inc()
default:
return false