From 3d360c06243fe48ada29a16bb511ade785d9525b Mon Sep 17 00:00:00 2001 From: congqixia Date: Thu, 19 Dec 2024 15:40:45 +0800 Subject: [PATCH] fix: SyncSegments rpc always failed (#38578) miss the patch due to code branching previous pr: #38032 Signed-off-by: Congqi Xia Co-authored-by: Wei Liu --- internal/datacoord/session/datanode_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/session/datanode_manager.go b/internal/datacoord/session/datanode_manager.go index e65f2cb95931c..b4edb64543259 100644 --- a/internal/datacoord/session/datanode_manager.go +++ b/internal/datacoord/session/datanode_manager.go @@ -229,8 +229,8 @@ func (c *DataNodeManagerImpl) SyncSegments(ctx context.Context, nodeID int64, re zap.Int64("nodeID", nodeID), zap.Int64("planID", req.GetPlanID()), ) - ctx, cancel := context.WithTimeout(context.Background(), paramtable.Get().DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second)) - cli, err := c.getClient(ctx, nodeID) + childCtx, cancel := context.WithTimeout(context.Background(), paramtable.Get().DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second)) + cli, err := c.getClient(childCtx, nodeID) cancel() if err != nil { log.Warn("failed to get client", zap.Error(err))