mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 12:29:36 +08:00
fix: Make SyncManager callback func ignore nil error (#32891)
introduced by #32865 sync manager callback handler panicked when error is nil Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
54a51b1236
commit
77fa615772
@ -134,6 +134,9 @@ func (mgr *syncManager) safeSubmitTask(task Task) *conc.Future[struct{}] {
|
||||
|
||||
func (mgr *syncManager) submit(key int64, task Task) *conc.Future[struct{}] {
|
||||
handler := func(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
// unexpected error
|
||||
if !errors.Is(err, errTargetSegmentNotMatch) {
|
||||
task.HandleError(err)
|
||||
|
@ -318,7 +318,6 @@ func (s *SyncManagerSuite) TestTargetUpdated() {
|
||||
task.EXPECT().CalcTargetSegment().Return(1001, nil).Once()
|
||||
task.EXPECT().Run().Return(errTargetSegmentNotMatch).Once()
|
||||
task.EXPECT().Run().Return(nil).Once()
|
||||
task.EXPECT().HandleError(mock.Anything)
|
||||
|
||||
f := manager.SyncData(context.Background(), task)
|
||||
_, err = f.Await()
|
||||
|
Loading…
Reference in New Issue
Block a user