fix: Deadlock in compaction handler (#37868)

issue: #37803

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-11-21 17:26:46 +08:00 committed by GitHub
parent 70e6a00ba1
commit 2159526e80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -303,6 +303,7 @@ func (c *compactionPlanHandler) schedule() []CompactionTask {
c.executingGuard.Lock()
c.executingTasks[t.GetTaskProto().GetPlanID()] = t
if len(c.executingTasks) >= parallelism {
c.executingGuard.Unlock()
break // 2. the parallelism of running tasks is reached
}
c.executingGuard.Unlock()