From 80667262c6608c5cec01043d441c0189b03cb0b2 Mon Sep 17 00:00:00 2001 From: wei liu Date: Thu, 28 Nov 2024 17:58:36 +0800 Subject: [PATCH] fix: SyncSegments rpc always failed (#38032) issue: #38031 cause call `cli.SyncSegments` use ctx which already be override and canceled, so SyncSegments rpc will always failed. Signed-off-by: Wei Liu Signed-off-by: Congqi Xia --- internal/datacoord/session_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/session_manager.go b/internal/datacoord/session_manager.go index fe2b542146f10..c962bf9797ce7 100644 --- a/internal/datacoord/session_manager.go +++ b/internal/datacoord/session_manager.go @@ -230,8 +230,8 @@ func (c *SessionManagerImpl) SyncSegments(ctx context.Context, nodeID int64, req zap.Int64("planID", req.GetPlanID()), ) - ctx, cancel := context.WithTimeout(context.Background(), Params.DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second)) - cli, err := c.getClient(ctx, nodeID) + childCtx, cancel := context.WithTimeout(context.Background(), Params.DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second)) + cli, err := c.getClient(childCtx, nodeID) cancel() if err != nil { log.Warn("failed to get client", zap.Error(err))