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