This is an automated email from the ASF dual-hosted git repository.
journey pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 7762a62 add null check in SubProcessTaskExecThread (#1737)
7762a62 is described below
commit 7762a622701929a8c9bd48ded0332e2eaa3388ee
Author: Yelli <[email protected]>
AuthorDate: Tue Jan 7 11:07:23 2020 +0800
add null check in SubProcessTaskExecThread (#1737)
* modify FileUtils.readFile2Str
* #1300 Add right alignment function in sql email content
* cancel formatted for alert_mail_template.ftl
* #747 sql task password Log desensitization
* cancel mail_temple
* edit ExcelUtils
* modify test method name
* #747 sql task password Log desensitization
* #1544 workflow import
* Constants add DATASOURCE_PASSWORD_REGEX
* #747 sql task password Log desensitization
* deal with import project have sub process
* modify export process addTaskNodeParam method name
* add testAddTaskNodeSpecialParam UT
* add ProcessDefinitionServiceTest-ut to pom
* add testImportSubProcess in ProcessDefinitionServiceTest
* add testImportSubProcess in ProcessDefinitionServiceTest
* add testImportProcessDefinition
* fix sonar bug: not enough arguments
* fix sonar bug: change condition & not enough arguments
* fix bug sonar: add null check in daghelper && add hashcode method in
ProcessData
* fix bug sonar: add null check in daghelper
* CollectionUtils.isEmpty()
* add hashcode() && null check
* merge if
* remove hashcode
* remove e.getMessage
---
.../api/service/ResourcesService.java | 31 +++++++++-------------
.../master/runner/SubProcessTaskExecThread.java | 8 +++---
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
index 8a6ffb8..3093dae 100644
---
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
+++
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
@@ -16,12 +16,15 @@
*/
package org.apache.dolphinscheduler.api.service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.collections.BeanMap;
+import org.apache.commons.lang.StringUtils;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ResourceType;
-import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.FileUtils;
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
@@ -29,10 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.UdfFunc;
import org.apache.dolphinscheduler.dao.entity.User;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.commons.collections.BeanMap;
-import org.apache.commons.lang.StringUtils;
import org.apache.dolphinscheduler.dao.mapper.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -113,14 +112,12 @@ public class ResourcesService extends BaseService {
putMsg(result, Status.RESOURCE_SUFFIX_FORBID_CHANGE);
return result;
}
- //
+
//If resource type is UDF, only jar packages are allowed to be
uploaded, and the suffix must be .jar
- if (Constants.UDF.equals(type.name())) {
- if (!JAR.equalsIgnoreCase(fileSuffix)) {
- logger.error(Status.UDF_RESOURCE_SUFFIX_NOT_JAR.getMsg());
- putMsg(result, Status.UDF_RESOURCE_SUFFIX_NOT_JAR);
- return result;
- }
+ if (Constants.UDF.equals(type.name()) &&
!JAR.equalsIgnoreCase(fileSuffix)) {
+ logger.error(Status.UDF_RESOURCE_SUFFIX_NOT_JAR.getMsg());
+ putMsg(result, Status.UDF_RESOURCE_SUFFIX_NOT_JAR);
+ return result;
}
if (file.getSize() > Constants.maxFileSize) {
logger.error("file size is too large: {}",
file.getOriginalFilename());
@@ -226,12 +223,10 @@ public class ResourcesService extends BaseService {
}
//check resource aleady exists
- if (!resource.getAlias().equals(name)) {
- if (checkResourceExists(name, 0, type.ordinal())) {
- logger.error("resource {} already exists, can't recreate",
name);
- putMsg(result, Status.RESOURCE_EXIST);
- return result;
- }
+ if (!resource.getAlias().equals(name) && checkResourceExists(name, 0,
type.ordinal())) {
+ logger.error("resource {} already exists, can't recreate", name);
+ putMsg(result, Status.RESOURCE_EXIST);
+ return result;
}
// query tenant by user id
diff --git
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/SubProcessTaskExecThread.java
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/SubProcessTaskExecThread.java
index 5ee5d01..0026de7 100644
---
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/SubProcessTaskExecThread.java
+++
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/SubProcessTaskExecThread.java
@@ -81,9 +81,11 @@ public class SubProcessTaskExecThread extends
MasterBaseTaskExecThread {
result = true;
}catch (Exception e){
- logger.error("exception: "+ e.getMessage(),e);
- logger.error("wait task quit failed, instance id:{}, task id:{}",
- processInstance.getId(), taskInstance.getId());
+ logger.error("exception: ",e);
+ if (null != taskInstance) {
+ logger.error("wait task quit failed, instance id:{}, task
id:{}",
+ processInstance.getId(), taskInstance.getId());
+ }
}
return result;
}