Browse Source

[Bug][Master] remove check with executePath when kill yarn job (#5552)

* [Bug][Master] remove check with executePath when kill yarn job

* [Bug][Master] init execute path if not exist

* [Bug][Master] move createWorkDirIfAbsent out side of executePath calculate  part

Co-authored-by: wanggang <wanggy01@servyou.com.cn>
pull/3/MERGE
geosmart 3 years ago committed by GitHub
parent
commit
56273319a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java

13
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java

@ -449,12 +449,15 @@ public class ProcessUtils {
taskExecutionContext.getLogPath()); taskExecutionContext.getLogPath());
} }
if (StringUtils.isNotEmpty(log)) { if (StringUtils.isNotEmpty(log)) {
List<String> appIds = LoggerUtils.getAppIds(log, logger); if (StringUtils.isEmpty(taskExecutionContext.getExecutePath())) {
String workerDir = taskExecutionContext.getExecutePath(); taskExecutionContext.setExecutePath(FileUtils.getProcessExecDir(taskExecutionContext.getProjectCode(),
if (StringUtils.isEmpty(workerDir)) { taskExecutionContext.getProcessDefineCode(),
logger.error("task instance work dir is empty"); taskExecutionContext.getProcessDefineVersion(),
throw new RuntimeException("task instance work dir is empty"); taskExecutionContext.getProcessInstanceId(),
taskExecutionContext.getTaskInstanceId()));
} }
FileUtils.createWorkDirIfAbsent(taskExecutionContext.getExecutePath());
List<String> appIds = LoggerUtils.getAppIds(log, logger);
if (CollectionUtils.isNotEmpty(appIds)) { if (CollectionUtils.isNotEmpty(appIds)) {
cancelApplication(appIds, logger, taskExecutionContext.getTenantCode(), taskExecutionContext.getExecutePath()); cancelApplication(appIds, logger, taskExecutionContext.getTenantCode(), taskExecutionContext.getExecutePath());
return appIds; return appIds;

Loading…
Cancel
Save