mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 20:39:36 +08:00
Fix memory leak in indexservice (#5779)
Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
parent
ebe5073749
commit
324f5d1df7
@ -474,12 +474,19 @@ func (nt *nodeTasks) finishTask(indexBuildID UniqueID) {
|
||||
nt.lock.Lock()
|
||||
defer nt.lock.Unlock()
|
||||
|
||||
for serverID := range nt.nodeID2Tasks {
|
||||
for i, buildID := range nt.nodeID2Tasks[serverID] {
|
||||
if buildID == indexBuildID {
|
||||
nt.nodeID2Tasks[serverID] = append(nt.nodeID2Tasks[serverID][:i], nt.nodeID2Tasks[serverID][:i+1]...)
|
||||
removed := false
|
||||
for serverID, taskIDs := range nt.nodeID2Tasks {
|
||||
for i := 0; i < len(taskIDs); i++ {
|
||||
if indexBuildID == taskIDs[i] {
|
||||
taskIDs = append(taskIDs[:i], taskIDs[i+1:]...)
|
||||
removed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if removed {
|
||||
nt.nodeID2Tasks[serverID] = taskIDs
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user