fix: pipeline/delegator leak (#42582)

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

Signed-off-by: Buqian Zheng <buqianzheng@Buqians-MacBook-Air.local>
Co-authored-by: Buqian Zheng <buqianzheng@Buqians-MacBook-Air.local>
This commit is contained in:
Buqian Zheng 2025-06-06 22:00:32 +08:00 committed by GitHub
parent f81652ebbc
commit b4d549d96a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)