Call release memory in case error occured (#15237)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/15250/head
zhenshan.cao 2022-01-17 14:43:38 +08:00 committed by GitHub
parent 675e6d352b
commit 871e093dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -505,6 +505,8 @@ func (it *IndexBuildTask) Execute(ctx context.Context) error {
return err
}
defer it.releaseMemory()
var err error
it.index, err = NewCIndex(it.newTypeParams, it.newIndexParams)
if err != nil {
@ -538,7 +540,5 @@ func (it *IndexBuildTask) Execute(ctx context.Context) error {
log.Info("IndexNode CreateIndex successfully ", zap.Int64("collect", it.collectionID),
zap.Int64("partition", it.partitionID), zap.Int64("segment", it.segmentID))
it.releaseMemory()
return nil
}