fix: Remove channel when create flowgraph timeout (#33014)

See also #33013

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/33035/head
congqixia 2024-05-14 10:07:33 +08:00 committed by GitHub
parent cba2c7a3be
commit 4ae7cabb04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -361,6 +361,12 @@ func getServiceWithChannel(initCtx context.Context, node *DataNode, info *datapb
log.Warn("failed to register channel buffer", zap.Error(err))
return nil, err
}
defer func() {
if err != nil {
defer node.writeBufferManager.RemoveChannel(channelName)
}
}()
ctx, cancel := context.WithCancel(node.ctx)
ds := &dataSyncService{
ctx: ctx,