Fix delegator leaked (#25347)

Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
yah01 2023-07-06 14:18:26 +08:00 committed by GitHub
parent dd5f896dc8
commit 3d2283415f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,7 +358,7 @@ func (node *QueryNode) UnsubDmChannel(ctx context.Context, req *querypb.UnsubDmC
return status, nil
}
delegator, ok := node.delegators.Get(req.GetChannelName())
delegator, ok := node.delegators.GetAndRemove(req.GetChannelName())
if ok {
// close the delegator first to block all coming query/search requests
delegator.Close()
@ -366,7 +366,6 @@ func (node *QueryNode) UnsubDmChannel(ctx context.Context, req *querypb.UnsubDmC
node.pipelineManager.Remove(req.GetChannelName())
node.manager.Segment.RemoveBy(segments.WithChannel(req.GetChannelName()))
node.tSafeManager.Remove(req.GetChannelName())
node.delegators.GetAndRemove(req.GetChannelName())
}
log.Info("unsubscribed channel")