From 3915ecaceea35d26657f741a36d065737a5a66be Mon Sep 17 00:00:00 2001 From: Buqian Zheng Date: Sat, 7 Jun 2025 02:06:33 +0800 Subject: [PATCH] fix: pipeline/delegator leak (#42583) the manager's logging lambda should not capture the pipeline object this creates a circular reference between the manager and the pipeline object, making it impossible for both to be GC-ed. issue: https://github.com/milvus-io/milvus/issues/42581 pr: https://github.com/milvus-io/milvus/pull/42582 Signed-off-by: Buqian Zheng Co-authored-by: Buqian Zheng --- internal/util/pipeline/pipeline.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/util/pipeline/pipeline.go b/internal/util/pipeline/pipeline.go index d439ab923c..896ca878ac 100644 --- a/internal/util/pipeline/pipeline.go +++ b/internal/util/pipeline/pipeline.go @@ -48,8 +48,9 @@ func (p *pipeline) Add(nodes ...Node) { func (p *pipeline) addNode(node Node) { nodeCtx := NewNodeCtx(node) if p.enableTtChecker { - manager := timerecord.GetCheckerManger("fgNode", p.nodeTtInterval, func(list []string) { - log.Warn("some node(s) haven't received input", zap.Strings("list", list), zap.Duration("duration ", p.nodeTtInterval)) + nodeTtInterval := p.nodeTtInterval + manager := timerecord.GetCheckerManger("fgNode", nodeTtInterval, func(list []string) { + log.Warn("some node(s) haven't received input", zap.Strings("list", list), zap.Duration("duration ", nodeTtInterval)) }) name := fmt.Sprintf("nodeCtxTtChecker-%s", node.Name()) nodeCtx.Checker = timerecord.NewChecker(name, manager)