enhance: add pool for scheduler dmQueue task (#30103)

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
pull/30186/head
aoiasd 2024-01-19 14:20:54 +08:00 committed by GitHub
parent 15716ec283
commit 4ef6217fc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -503,7 +503,7 @@ func (sched *taskScheduler) controlLoop() {
func (sched *taskScheduler) manipulationLoop() { func (sched *taskScheduler) manipulationLoop() {
defer sched.wg.Done() defer sched.wg.Done()
pool := conc.NewPool[struct{}](paramtable.Get().ProxyCfg.MaxTaskNum.GetAsInt())
for { for {
select { select {
case <-sched.ctx.Done(): case <-sched.ctx.Done():
@ -511,7 +511,10 @@ func (sched *taskScheduler) manipulationLoop() {
case <-sched.dmQueue.utChan(): case <-sched.dmQueue.utChan():
if !sched.dmQueue.utEmpty() { if !sched.dmQueue.utEmpty() {
t := sched.scheduleDmTask() t := sched.scheduleDmTask()
go sched.processTask(t, sched.dmQueue) pool.Submit(func() (struct{}, error) {
sched.processTask(t, sched.dmQueue)
return struct{}{}, nil
})
} }
} }
} }