Skip to content

Commit

Permalink
Fix missing error handle (#239)
Browse files Browse the repository at this point in the history
Signed-off-by: wayblink <anyang.wang@zilliz.com>
  • Loading branch information
wayblink authored Nov 27, 2023
1 parent 69c0905 commit bf9c18f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/backup_impl_create_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ func (b *BackupContext) executeCreateBackup(ctx context.Context, request *backup

wp, err := common.NewWorkerPool(ctx, b.params.BackupCfg.BackupParallelism, RPS)
if err != nil {
backupInfo.StateCode = backuppb.BackupTaskStateCode_BACKUP_FAIL
backupInfo.ErrorMessage = err.Error()
return backupInfo, err
}
wp.Start()
Expand All @@ -572,6 +574,8 @@ func (b *BackupContext) executeCreateBackup(ctx context.Context, request *backup
toBackupCollections, err := b.parseBackupCollections(request)
if err != nil {
log.Error("parse backup collections from request failed", zap.Error(err))
backupInfo.StateCode = backuppb.BackupTaskStateCode_BACKUP_FAIL
backupInfo.ErrorMessage = err.Error()
return backupInfo, err
}
collectionNames := make([]string, len(toBackupCollections))
Expand All @@ -590,12 +594,16 @@ func (b *BackupContext) executeCreateBackup(ctx context.Context, request *backup
}
wp.Done()
if err := wp.Wait(); err != nil {
backupInfo.StateCode = backuppb.BackupTaskStateCode_BACKUP_FAIL
backupInfo.ErrorMessage = err.Error()
return backupInfo, err
}

var backupSize int64 = 0
leveledBackupInfo, err := treeToLevel(backupInfo)
if err != nil {
backupInfo.StateCode = backuppb.BackupTaskStateCode_BACKUP_FAIL
backupInfo.ErrorMessage = err.Error()
return backupInfo, err
}
for _, coll := range leveledBackupInfo.collectionLevel.GetInfos() {
Expand Down

0 comments on commit bf9c18f

Please sign in to comment.