From c441cd499d0a6c2ac536f2f5644122349e8767f5 Mon Sep 17 00:00:00 2001 From: lilin Date: Wed, 18 Sep 2019 22:03:31 +0800 Subject: [PATCH 1/6] misspell words --- docs/en_US/EasyScheduler Proposal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en_US/EasyScheduler Proposal.md b/docs/en_US/EasyScheduler Proposal.md index 965605f63b..552067fe47 100644 --- a/docs/en_US/EasyScheduler Proposal.md +++ b/docs/en_US/EasyScheduler Proposal.md @@ -6,7 +6,7 @@ EasyScheduler is a distributed ETL scheduling engine with powerful DAG visualiza ## Proposal -EasyScheduler provides many easy-to-use features to accelerate the engineer enficiency on data ETL workflow job. We propose a new concept of 'instance of process' and 'instance of task' to let developers to tuning their jobs on the running state of workflow instead of changing the task's template. Its main objectives are as follows: +EasyScheduler provides many easy-to-use features to accelerate the engineer efficiency on data ETL workflow job. We propose a new concept of 'instance of process' and 'instance of task' to let developers to tuning their jobs on the running state of workflow instead of changing the task's template. Its main objectives are as follows: - Define the complex tasks' dependencies & triggers in a DAG graph by dragging and dropping. - Support cluster HA. From d1e7a796ceb684b2bbd22e6c9be7bc32a7419bfa Mon Sep 17 00:00:00 2001 From: lilin Date: Tue, 17 Dec 2019 20:50:48 +0800 Subject: [PATCH 2/6] modify common queue TaskQueueZKImplTest.java unit test --- .../common/queue/TaskQueueZkImpl.java | 6 +- .../common/queue/TaskQueueImplTest.java | 112 --------- .../common/queue/TaskQueueZKImplTest.java | 228 ++++++++++++++++++ pom.xml | 1 + 4 files changed, 230 insertions(+), 117 deletions(-) delete mode 100644 dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java create mode 100644 dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java index 76d88868f2..b0ecc62710 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/queue/TaskQueueZkImpl.java @@ -145,7 +145,6 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue { public List poll(String key, int tasksNum) { try{ CuratorFramework zk = getZkClient(); - String tasksQueuePath = getTasksPath(key) + Constants.SINGLE_SLASH; List list = zk.getChildren().forPath(getTasksPath(key)); if(list != null && list.size() > 0){ @@ -155,7 +154,6 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue { int size = list.size(); - Set taskTreeSet = new TreeSet<>(new Comparator() { @Override public int compare(String o1, String o2) { @@ -183,7 +181,7 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue { String taskDetail = list.get(i); String[] taskDetailArrs = taskDetail.split(Constants.UNDERLINE); - //forward compatibility 向前版本兼容 + //forward compatibility if(taskDetailArrs.length >= 4){ //format ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} @@ -201,9 +199,7 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue { formatTask += Constants.UNDERLINE + taskDetailArrs[4]; } taskTreeSet.add(formatTask); - } - } List taskslist = getTasksListFromTreeSet(tasksNum, taskTreeSet); diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java deleted file mode 100644 index 14e90ebcdc..0000000000 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dolphinscheduler.common.queue; - -import org.apache.dolphinscheduler.common.Constants; -import org.apache.dolphinscheduler.common.utils.IpUtils; -import org.apache.dolphinscheduler.common.utils.OSUtils; -import org.apache.dolphinscheduler.common.zk.ZKServer; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Random; - -import static org.junit.Assert.assertEquals; - -/** - * task queue test - */ -public class TaskQueueImplTest { - - private static final Logger logger = LoggerFactory.getLogger(TaskQueueImplTest.class); - - ITaskQueue tasksQueue = null; - - @Before - public void before(){ - ZKServer.start(); - - tasksQueue = TaskQueueFactory.getTaskQueueInstance(); - - //clear all data - tasksQueue.delete(); - - } - - - @After - public void after(){ - //clear all data - tasksQueue.delete(); - ZKServer.stop(); - } - - - @Test - public void testAdd(){ - - - //add - tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"1_0_1_1_-1"); - tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"0_1_1_1_-1"); - tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"0_0_0_1_" + IpUtils.ipToLong(OSUtils.getHost())); - tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"1_2_1_1_" + IpUtils.ipToLong(OSUtils.getHost()) + 10); - - List tasks = tasksQueue.poll(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, 1); - - if(tasks.size() <= 0){ - return; - } - - //pop - String node1 = tasks.get(0); - - assertEquals(node1,"0_0_0_1_" + IpUtils.ipToLong(OSUtils.getHost())); - - - } - - - - /** - * test one million data from zookeeper queue - */ - @Ignore - @Test - public void extremeTest(){ - int total = 30 * 10000; - - for(int i = 0; i < total; i++) { - for(int j = 0; j < total; j++) { - //${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} - //format ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} - String formatTask = String.format("%s_%d_%s_%d", i, i + 1, j, j == 0 ? 0 : j + new Random().nextInt(100)); - tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, formatTask); - } - } - - String node1 = tasksQueue.poll(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, 1).get(0); - assertEquals(node1,"0"); - - } - -} diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java new file mode 100644 index 0000000000..3db253daf0 --- /dev/null +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java @@ -0,0 +1,228 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dolphinscheduler.common.queue; + +import org.apache.dolphinscheduler.common.Constants; +import org.apache.dolphinscheduler.common.utils.IpUtils; +import org.apache.dolphinscheduler.common.utils.OSUtils; + +import org.apache.dolphinscheduler.common.zk.ZKServer; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +import java.util.List; +import java.util.Random; + +import static org.junit.Assert.*; + +/** + * task queue test + */ +public class TaskQueueZKImplTest { + + + private ITaskQueue tasksQueue = null; + + @Before + public void before(){ + + ZKServer.start(); + tasksQueue = TaskQueueFactory.getTaskQueueInstance(); + //clear all data + tasksQueue.delete(); + } + + @After + public void after(){ + //clear all data + tasksQueue.delete(); + ZKServer.stop(); + } + + + /** + * test take out all the elements + */ + @Test + public void getAllTasks(){ + + //add + init(); + // get all + List allTasks = tasksQueue.getAllTasks(Constants.DOLPHINSCHEDULER_TASKS_QUEUE); + assertEquals(allTasks.size(),2); + //delete all + tasksQueue.delete(); + allTasks = tasksQueue.getAllTasks(Constants.DOLPHINSCHEDULER_TASKS_QUEUE); + assertEquals(allTasks.size(),0); + } + + /** + * test check task exists in the task queue or not + */ + @Test + public void checkTaskExists(){ + + String task= "1_0_1_1_-1"; + //add + init(); + // check Exist true + boolean taskExists = tasksQueue.checkTaskExists(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, task); + assertTrue(taskExists); + + //remove task + tasksQueue.removeNode(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + // check Exist false + taskExists = tasksQueue.checkTaskExists(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, task); + assertFalse(taskExists); + } + + /** + * test add element to the queue + */ + @Test + public void add(){ + + //add + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"1_0_1_1_-1"); + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"0_1_1_1_-1"); + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"0_0_0_1_" + IpUtils.ipToLong(OSUtils.getHost())); + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"1_2_1_1_" + IpUtils.ipToLong(OSUtils.getHost()) + 10); + + List tasks = tasksQueue.poll(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, 1); + + if(tasks.size() <= 0){ + return; + } + + //pop + String node1 = tasks.get(0); + assertEquals(node1,"0_0_0_1_" + IpUtils.ipToLong(OSUtils.getHost())); + } + + /** + * test element pops out of the queue + */ + @Test + public void poll(){ + + //add + init(); + List taskList = tasksQueue.poll(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, 2); + assertEquals(taskList.size(),2); + + assertEquals(taskList.get(0),"0_1_1_1_-1"); + assertEquals(taskList.get(1),"1_0_1_1_-1"); + } + + /** + * test remove element from queue + */ + @Test + public void removeNode(){ + String task = "1_0_1_1_-1"; + //add + init(); + tasksQueue.removeNode(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + assertFalse(tasksQueue.checkTaskExists(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task)); + } + + /** + * test add an element to the set + */ + @Test + public void sadd(){ + + String task = "1_0_1_1_-1"; + tasksQueue.sadd(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + //check size + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),1); + } + + + /** + * test delete the value corresponding to the key in the set + */ + @Test + public void srem(){ + + String task = "1_0_1_1_-1"; + tasksQueue.sadd(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + //check size + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),1); + //remove and get size + tasksQueue.srem(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),0); + } + + /** + * test gets all the elements of the set based on the key + */ + @Test + public void smembers(){ + + //first init + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),0); + //add + String task = "1_0_1_1_-1"; + tasksQueue.sadd(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + //check size + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),1); + //add + task = "0_1_1_1_"; + tasksQueue.sadd(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,task); + //check size + assertEquals(tasksQueue.smembers(Constants.DOLPHINSCHEDULER_TASKS_QUEUE).size(),2); + } + + + /** + * init data + */ + private void init(){ + //add + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"1_0_1_1_-1"); + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE,"0_1_1_1_-1"); + } + + + + /** + * test one million data from zookeeper queue + */ + @Ignore + @Test + public void extremeTest(){ + int total = 30 * 10000; + + for(int i = 0; i < total; i++) { + for(int j = 0; j < total; j++) { + //${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} + //format ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} + String formatTask = String.format("%s_%d_%s_%d", i, i + 1, j, j == 0 ? 0 : j + new Random().nextInt(100)); + tasksQueue.add(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, formatTask); + } + } + + String node1 = tasksQueue.poll(Constants.DOLPHINSCHEDULER_TASKS_QUEUE, 1).get(0); + assertEquals(node1,"0"); + + } + +} diff --git a/pom.xml b/pom.xml index 2524461575..2413c56f21 100644 --- a/pom.xml +++ b/pom.xml @@ -614,6 +614,7 @@ **/common/utils/*.java **/common/graph/*.java + **/common/queue/*.java **/api/utils/CheckUtilsTest.java **/api/utils/FileUtilsTest.java From f98a5ddbd0cb2ab579665a53a4667e4d98f1bc6e Mon Sep 17 00:00:00 2001 From: lilin Date: Wed, 18 Dec 2019 11:10:19 +0800 Subject: [PATCH 3/6] extends BaseTaskQueueTest get zkServer --- .../common/queue/TaskQueueZKImplTest.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java index 3db253daf0..b13f4f63c5 100644 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueZKImplTest.java @@ -19,8 +19,6 @@ package org.apache.dolphinscheduler.common.queue; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.utils.IpUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; - -import org.apache.dolphinscheduler.common.zk.ZKServer; import org.junit.After; import org.junit.Before; import org.junit.Ignore; @@ -34,16 +32,14 @@ import static org.junit.Assert.*; /** * task queue test */ -public class TaskQueueZKImplTest { +public class TaskQueueZKImplTest extends BaseTaskQueueTest { + - private ITaskQueue tasksQueue = null; @Before public void before(){ - ZKServer.start(); - tasksQueue = TaskQueueFactory.getTaskQueueInstance(); //clear all data tasksQueue.delete(); } @@ -52,10 +48,8 @@ public class TaskQueueZKImplTest { public void after(){ //clear all data tasksQueue.delete(); - ZKServer.stop(); } - /** * test take out all the elements */ From deb215eceff5fb2896519c0131e3f96ad3e63698 Mon Sep 17 00:00:00 2001 From: lilin Date: Wed, 18 Dec 2019 13:19:51 +0800 Subject: [PATCH 4/6] modify zk config --- dolphinscheduler-common/src/main/resources/zookeeper.properties | 2 +- .../java/org/apache/dolphinscheduler/common/zk/ZKServer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-common/src/main/resources/zookeeper.properties b/dolphinscheduler-common/src/main/resources/zookeeper.properties index 529e8c2803..66b533c0c1 100644 --- a/dolphinscheduler-common/src/main/resources/zookeeper.properties +++ b/dolphinscheduler-common/src/main/resources/zookeeper.properties @@ -16,7 +16,7 @@ # #zookeeper cluster. multiple are separated by commas. eg. 192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181 -zookeeper.quorum=192.168.220.188:2181 +zookeeper.quorum=localhost:2181 #dolphinscheduler root directory zookeeper.dolphinscheduler.root=/dolphinscheduler diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/zk/ZKServer.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/zk/ZKServer.java index 9d33fe1a1d..fc39e62ed8 100644 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/zk/ZKServer.java +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/zk/ZKServer.java @@ -39,7 +39,7 @@ public class ZKServer { private static volatile PublicZooKeeperServerMain zkServer = null; - public static final int DEFAULT_ZK_TEST_PORT = 22181; + public static final int DEFAULT_ZK_TEST_PORT = 2181; public static final String DEFAULT_ZK_STR = "localhost:" + DEFAULT_ZK_TEST_PORT; From 3cccfa30374a7b3bfef1916f363ff32200d44c69 Mon Sep 17 00:00:00 2001 From: lilin Date: Fri, 27 Dec 2019 14:44:01 +0800 Subject: [PATCH 5/6] updateToken add entity exist check --- .../dolphinscheduler/api/service/AccessTokenService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java index 4664b59763..897646ba70 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AccessTokenService.java @@ -154,8 +154,13 @@ public class AccessTokenService extends BaseService { */ public Map updateToken(int id,int userId, String expireTime, String token) { Map result = new HashMap<>(5); - AccessToken accessToken = new AccessToken(); - accessToken.setId(id); + + AccessToken accessToken = accessTokenMapper.selectById(id); + if (accessToken == null) { + logger.error("access token not exist, access token id {}", id); + putMsg(result, Status.ACCESS_TOKEN_NOT_EXIST); + return result; + } accessToken.setUserId(userId); accessToken.setExpireTime(DateUtils.stringToDate(expireTime)); accessToken.setToken(token); From 67367658442af0ede799afc9db668b8a1af381a4 Mon Sep 17 00:00:00 2001 From: lilin Date: Fri, 27 Dec 2019 15:22:25 +0800 Subject: [PATCH 6/6] 1 word error 2 modify check project perm may NPE 3 modify checkResult may NPE 4 update project add desc check --- .../api/service/ProjectService.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java index f33a365912..8f9a62000a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java @@ -41,7 +41,7 @@ import static org.apache.dolphinscheduler.api.utils.CheckUtils.checkDesc; /** * project service *HttpTask./ -**/ + **/ @Service public class ProjectService extends BaseService{ @@ -121,7 +121,7 @@ public class ProjectService extends BaseService{ * @param loginUser login user * @param project project * @param projectName project name - * @return true if the login user havve permission to see the project + * @return true if the login user have permission to see the project */ public Map checkProjectAndAuth(User loginUser, Project project, String projectName) { @@ -143,7 +143,7 @@ public class ProjectService extends BaseService{ public boolean hasProjectAndPerm(User loginUser, Project project, Map result) { boolean checkResult = false; if (project == null) { - putMsg(result, Status.PROJECT_NOT_FOUNT, project.getName()); + putMsg(result, Status.PROJECT_NOT_FOUNT, ""); } else if (!checkReadPermission(loginUser, project)) { putMsg(result, Status.USER_NO_OPERATION_PROJECT_PERM, loginUser.getUserName(), project.getName()); } else { @@ -199,13 +199,14 @@ public class ProjectService extends BaseService{ if (checkResult != null) { return checkResult; } - List processDefinitionList = processDefinitionMapper.queryAllDefinitionList(projectId); if (!hasPerm(loginUser, project.getUserId())) { putMsg(result, Status.USER_NO_OPERATION_PERM); return result; } + List processDefinitionList = processDefinitionMapper.queryAllDefinitionList(projectId); + if(processDefinitionList.size() > 0){ putMsg(result, Status.DELETE_PROJECT_ERROR_DEFINES_NOT_NULL); return result; @@ -227,7 +228,8 @@ public class ProjectService extends BaseService{ * @return check result */ private Map getCheckResult(User loginUser, Project project) { - Map checkResult = checkProjectAndAuth(loginUser, project, project.getName()); + String projectName = project == null ? null:project.getName(); + Map checkResult = checkProjectAndAuth(loginUser, project, projectName); Status status = (Status) checkResult.get(Constants.STATUS); if (status != Status.SUCCESS) { return checkResult; @@ -247,6 +249,11 @@ public class ProjectService extends BaseService{ public Map update(User loginUser, Integer projectId, String projectName, String desc) { Map result = new HashMap<>(5); + Map descCheck = checkDesc(desc); + if (descCheck.get(Constants.STATUS) != Status.SUCCESS) { + return descCheck; + } + Project project = projectMapper.selectById(projectId); boolean hasProjectAndPerm = hasProjectAndPerm(loginUser, project, result); if (!hasProjectAndPerm) {