Fix an issue where working task might get cleaned up (#19888)

/kind improvement

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
pull/19906/head
Ten Thousand Leaves 2022-10-19 13:23:28 +08:00 committed by GitHub
parent b361842e9a
commit 762045adff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -889,7 +889,7 @@ func (m *importManager) expireOldTasksFromMem() {
defer m.workingLock.Unlock()
for _, v := range m.workingTasks {
taskExpiredAndStateUpdated := false
if taskExpired(v) {
if v.GetState().GetStateCode() != commonpb.ImportState_ImportCompleted && taskExpired(v) {
log.Info("a working task has expired", zap.Int64("task ID", v.GetId()))
taskID := v.GetId()
m.workingLock.Unlock()