fix: Return err for conc.Future in sync manager (#31790)

Should not return `err, nil` when using conc.Future, as the error will
be lost/ignored when using `AwaitAll` to wait for the future.

issue: https://github.com/milvus-io/milvus/issues/31788

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/31833/head
yihao.dai 2024-04-07 02:36:57 +08:00 committed by GitHub
parent 23ba2a5388
commit d6cdcf74db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ func (mgr *syncManager) safeSubmitTask(task Task) *conc.Future[error] {
for {
targetID, err := task.CalcTargetSegment()
if err != nil {
return err, nil
return err, err
}
log.Info("task calculated target segment id",
zap.Int64("targetID", targetID),
@ -142,7 +142,7 @@ func (mgr *syncManager) safeSubmitTask(task Task) *conc.Future[error] {
log.Info("target updated during submitting", zap.Error(err))
continue
}
return err, nil
return err, err
}
})
}