status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
} /** * kill task */ public void kill() { if (task != null) { try { task.cancelApplication(true); TaskInstance taskInstance = processService.findTaskInstanceById(taskExecutionContext.getTaskInstanceId()); if (taskInstance != null) { ProcessUtils.killYarnJob(taskExecutionContext); } } catch (Exception e) { logger.error(e.getMessage(), e); } } } /** * download resource file * * @param execLocalPath execLocalPath * @param projectRes projectRes * @param logger logger */ private void downloadResource(String execLocalPath, Map<String, String> projectRes, Logger logger) { if (MapUtils.isEmpty(projectRes)) { return; } Set<Map.Entry<String, String>> resEntries = projectRes.entrySet(); for (Map.Entry<String, String> resource : resEntries) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
String fullName = resource.getKey(); String tenantCode = resource.getValue(); File resFile = new File(execLocalPath, fullName); if (!resFile.exists()) { try { String resHdfsPath = HadoopUtils.getHdfsResourceFileName(tenantCode, fullName); logger.info("get resource file from hdfs :{}", resHdfsPath); HadoopUtils.getInstance().copyHdfsToLocal(resHdfsPath, execLocalPath + File.separator + fullName, false, true); } catch (Exception e) { logger.error(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } } else { logger.info("file : {} exists ", resFile.getName()); } } } /** * send an ack to change the status of the task. */ private void changeTaskExecutionStatusToRunning() { taskExecutionContext.setCurrentExecutionStatus(ExecutionStatus.RUNNING_EXECUTION); Command ackCommand = buildAckCommand().convert2Command(); try { RetryerUtils.retryCall(() -> { taskCallbackService.sendAck(taskExecutionContext.getTaskInstanceId(), ackCommand); return Boolean.TRUE; }); } catch (ExecutionException | RetryException e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
logger.error(e.getMessage(), e); } } /** * build ack command. * * @return TaskExecuteAckCommand */ private TaskExecuteAckCommand buildAckCommand() { TaskExecuteAckCommand ackCommand = new TaskExecuteAckCommand(); ackCommand.setTaskInstanceId(taskExecutionContext.getTaskInstanceId()); ackCommand.setStatus(taskExecutionContext.getCurrentExecutionStatus().getCode()); ackCommand.setStartTime(taskExecutionContext.getStartTime()); ackCommand.setLogPath(taskExecutionContext.getLogPath()); ackCommand.setHost(taskExecutionContext.getHost()); if (TaskType.SQL.getDesc().equalsIgnoreCase(taskExecutionContext.getTaskType()) || TaskType.PROCEDURE.getDesc().equalsIgnoreCase(taskExecutionContext.getTaskType())) { ackCommand.setExecutePath(null); } else { ackCommand.setExecutePath(taskExecutionContext.getExecutePath()); } return ackCommand; } /** * get current TaskExecutionContext * * @return TaskExecutionContext */ public TaskExecutionContext getTaskExecutionContext() { return this.taskExecutionContext; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
@Override public long getDelay(TimeUnit unit) { return unit.convert(DateUtils.getRemainTime(taskExecutionContext.getFirstSubmitTime(), taskExecutionContext.getDelayTime() * 60L), TimeUnit.SECONDS); } @Override public int compareTo(Delayed o) { if (o == null) { return 1; } return Long.compare(this.getDelay(TimeUnit.MILLISECONDS), o.getDelay(TimeUnit.MILLISECONDS)); } private void preBuildBusinessParams() { Map<String, Property> paramsMap = new HashMap<>(); if (taskExecutionContext.getScheduleTime() != null) { Date date = taskExecutionContext.getScheduleTime(); if (CommandType.COMPLEMENT_DATA.getCode() == taskExecutionContext.getCmdTypeIfComplement()) { date = DateUtils.add(taskExecutionContext.getScheduleTime(), DAY_OF_MONTH, 1); } String dateTime = DateUtils.format(date, Constants.PARAMETER_FORMAT_TIME); Property p = new Property(); p.setValue(dateTime); p.setProp(Constants.PARAMETER_DATETIME); paramsMap.put(Constants.PARAMETER_DATETIME, p); } taskExecutionContext.setParamsMap(paramsMap); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
/* * 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.service.queue.entity; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.TaskTimeoutStrategy; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.TaskExecuteRequestCommand; import org.apache.dolphinscheduler.spi.task.request.DataxTaskExecutionContext; import org.apache.dolphinscheduler.spi.task.request.ProcedureTaskExecutionContext; import org.apache.dolphinscheduler.spi.task.request.SQLTaskExecutionContext; import org.apache.dolphinscheduler.spi.task.request.SqoopTaskExecutionContext;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
import java.io.Serializable; import java.util.Date; import java.util.Map; import com.fasterxml.jackson.annotation.JsonFormat; /** * master/worker task transport */ public class TaskExecutionContext implements Serializable { /** * task id */ private int taskInstanceId; /** * task name */ private String taskName; /** * task first submit time. */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date firstSubmitTime; /** * task start time */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date startTime; /** * task type */ private String taskType;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
/** * host */ private String host; /** * task execute path */ private String executePath; /** * log path */ private String logPath; /** * task json */ private String taskJson; /** * processId */ private int processId; /** * processCode */ private Long processDefineCode; /** * processVersion */ private int processDefineVersion; /** * appIds
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
*/ private String appIds; /** * process instance id */ private int processInstanceId; /** * process instance schedule time */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date scheduleTime; /** * process instance global parameters */ private String globalParams; /** * execute user id */ private int executorId; /** * command type if complement */ private int cmdTypeIfComplement; /** * tenant code */ private String tenantCode; /** * task queue */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
private String queue; /** * project code */ private long projectCode; /** * taskParams */ private String taskParams; /** * envFile */ private String envFile; /** * environmentConfig */ private String environmentConfig; /** * definedParams */ private Map<String, String> definedParams; /** * task AppId */ private String taskAppId; /** * task timeout strategy */ private TaskTimeoutStrategy taskTimeoutStrategy; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
* task timeout */ private int taskTimeout; /** * worker group */ private String workerGroup; /** * delay execution time. */ private int delayTime; /** * current execution status */ private ExecutionStatus currentExecutionStatus; /** * resources full name and tenant code */ private Map<String, String> resources; /** * sql TaskExecutionContext */ private SQLTaskExecutionContext sqlTaskExecutionContext; /** * datax TaskExecutionContext */ private DataxTaskExecutionContext dataxTaskExecutionContext; /** * dependence TaskExecutionContext */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
private DependenceTaskExecutionContext dependenceTaskExecutionContext; /** * sqoop TaskExecutionContext */ private SqoopTaskExecutionContext sqoopTaskExecutionContext; /** * taskInstance varPool */ private String varPool; /** * business param */ private Map<String, Property> paramsMap; public Map<String, Property> getParamsMap() { return paramsMap; } public void setParamsMap(Map<String, Property> paramsMap) { this.paramsMap = paramsMap; } /** * procedure TaskExecutionContext */ private ProcedureTaskExecutionContext procedureTaskExecutionContext; public int getTaskInstanceId() { return taskInstanceId; } public void setTaskInstanceId(int taskInstanceId) { this.taskInstanceId = taskInstanceId; } public String getTaskName() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return taskName; } public void setTaskName(String taskName) { this.taskName = taskName; } public Date getFirstSubmitTime() { return firstSubmitTime; } public void setFirstSubmitTime(Date firstSubmitTime) { this.firstSubmitTime = firstSubmitTime; } public Date getStartTime() { return startTime; } public void setStartTime(Date startTime) { this.startTime = startTime; } public String getTaskType() { return taskType; } public void setTaskType(String taskType) { this.taskType = taskType; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getExecutePath() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return executePath; } public void setExecutePath(String executePath) { this.executePath = executePath; } public String getLogPath() { return logPath; } public void setLogPath(String logPath) { this.logPath = logPath; } public String getTaskJson() { return taskJson; } public void setTaskJson(String taskJson) { this.taskJson = taskJson; } public int getProcessId() { return processId; } public void setProcessId(int processId) { this.processId = processId; } public Long getProcessDefineCode() { return processDefineCode; } public void setProcessDefineCode(Long processDefineCode) { this.processDefineCode = processDefineCode; } public int getProcessDefineVersion() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return processDefineVersion; } public void setProcessDefineVersion(int processDefineVersion) { this.processDefineVersion = processDefineVersion; } public String getAppIds() { return appIds; } public void setAppIds(String appIds) { this.appIds = appIds; } public int getProcessInstanceId() { return processInstanceId; } public void setProcessInstanceId(int processInstanceId) { this.processInstanceId = processInstanceId; } public Date getScheduleTime() { return scheduleTime; } public void setScheduleTime(Date scheduleTime) { this.scheduleTime = scheduleTime; } public String getGlobalParams() { return globalParams; } public void setGlobalParams(String globalParams) { this.globalParams = globalParams; } public int getExecutorId() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return executorId; } public void setExecutorId(int executorId) { this.executorId = executorId; } public int getCmdTypeIfComplement() { return cmdTypeIfComplement; } public void setCmdTypeIfComplement(int cmdTypeIfComplement) { this.cmdTypeIfComplement = cmdTypeIfComplement; } public String getTenantCode() { return tenantCode; } public void setTenantCode(String tenantCode) { this.tenantCode = tenantCode; } public String getQueue() { return queue; } public void setQueue(String queue) { this.queue = queue; } public long getProjectCode() { return projectCode; } public void setProjectCode(long projectCode) { this.projectCode = projectCode; } public String getTaskParams() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return taskParams; } public void setTaskParams(String taskParams) { this.taskParams = taskParams; } public String getEnvFile() { return envFile; } public void setEnvFile(String envFile) { this.envFile = envFile; } public String getEnvironmentConfig() { return environmentConfig; } public void setEnvironmentConfig(String config) { this.environmentConfig = config; } public Map<String, String> getDefinedParams() { return definedParams; } public void setDefinedParams(Map<String, String> definedParams) { this.definedParams = definedParams; } public String getTaskAppId() { return taskAppId; } public void setTaskAppId(String taskAppId) { this.taskAppId = taskAppId; } public TaskTimeoutStrategy getTaskTimeoutStrategy() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return taskTimeoutStrategy; } public void setTaskTimeoutStrategy(TaskTimeoutStrategy taskTimeoutStrategy) { this.taskTimeoutStrategy = taskTimeoutStrategy; } public int getTaskTimeout() { return taskTimeout; } public void setTaskTimeout(int taskTimeout) { this.taskTimeout = taskTimeout; } public String getWorkerGroup() { return workerGroup; } public void setWorkerGroup(String workerGroup) { this.workerGroup = workerGroup; } public int getDelayTime() { return delayTime; } public void setDelayTime(int delayTime) { this.delayTime = delayTime; } public ExecutionStatus getCurrentExecutionStatus() { return currentExecutionStatus; } public void setCurrentExecutionStatus(ExecutionStatus currentExecutionStatus) { this.currentExecutionStatus = currentExecutionStatus; } public SQLTaskExecutionContext getSqlTaskExecutionContext() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
return sqlTaskExecutionContext; } public void setSqlTaskExecutionContext(SQLTaskExecutionContext sqlTaskExecutionContext) { this.sqlTaskExecutionContext = sqlTaskExecutionContext; } public DataxTaskExecutionContext getDataxTaskExecutionContext() { return dataxTaskExecutionContext; } public void setDataxTaskExecutionContext(DataxTaskExecutionContext dataxTaskExecutionContext) { this.dataxTaskExecutionContext = dataxTaskExecutionContext; } public ProcedureTaskExecutionContext getProcedureTaskExecutionContext() { return procedureTaskExecutionContext; } public void setProcedureTaskExecutionContext(ProcedureTaskExecutionContext procedureTaskExecutionContext) { this.procedureTaskExecutionContext = procedureTaskExecutionContext; } public Command toCommand() { TaskExecuteRequestCommand requestCommand = new TaskExecuteRequestCommand(); requestCommand.setTaskExecutionContext(JSONUtils.toJsonString(this)); return requestCommand.convert2Command(); } public DependenceTaskExecutionContext getDependenceTaskExecutionContext() { return dependenceTaskExecutionContext; } public void setDependenceTaskExecutionContext(DependenceTaskExecutionContext dependenceTaskExecutionContext) { this.dependenceTaskExecutionContext = dependenceTaskExecutionContext; } public Map<String, String> getResources() { return resources;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
} public void setResources(Map<String, String> resources) { this.resources = resources; } public SqoopTaskExecutionContext getSqoopTaskExecutionContext() { return sqoopTaskExecutionContext; } public void setSqoopTaskExecutionContext(SqoopTaskExecutionContext sqoopTaskExecutionContext) { this.sqoopTaskExecutionContext = sqoopTaskExecutionContext; } @Override public String toString() { return "TaskExecutionContext{" + "taskInstanceId=" + taskInstanceId + ", taskName='" + taskName + '\'' + ", currentExecutionStatus=" + currentExecutionStatus + ", firstSubmitTime=" + firstSubmitTime + ", startTime=" + startTime + ", taskType='" + taskType + '\'' + ", host='" + host + '\'' + ", executePath='" + executePath + '\'' + ", logPath='" + logPath + '\'' + ", taskJson='" + taskJson + '\'' + ", processId=" + processId + ", processDefineCode=" + processDefineCode + ", processDefineVersion=" + processDefineVersion + ", appIds='" + appIds + '\'' + ", processInstanceId=" + processInstanceId + ", scheduleTime=" + scheduleTime + ", globalParams='" + globalParams + '\''
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,438
[Improvement][Worker] remove meaningless DB query
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description remove meaningless DB query org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread In the process of task kill, it will query the DB to obtain the task instance object, but this judgment does not make any sense. In fact, the relevant context is already clear, so there is no need to query from DB. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6438
https://github.com/apache/dolphinscheduler/pull/6440
d284e44d52f75bd6c5f5756d9b7ae4a5af24fadc
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
"2021-10-01T17:01:38Z"
java
"2021-10-02T05:09:00Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/entity/TaskExecutionContext.java
+ ", executorId=" + executorId + ", cmdTypeIfComplement=" + cmdTypeIfComplement + ", tenantCode='" + tenantCode + '\'' + ", queue='" + queue + '\'' + ", projectCode=" + projectCode + ", taskParams='" + taskParams + '\'' + ", envFile='" + envFile + '\'' + ", definedParams=" + definedParams + ", taskAppId='" + taskAppId + '\'' + ", taskTimeoutStrategy=" + taskTimeoutStrategy + ", taskTimeout=" + taskTimeout + ", workerGroup='" + workerGroup + '\'' + ", environmentConfig='" + environmentConfig + '\'' + ", delayTime=" + delayTime + ", resources=" + resources + ", sqlTaskExecutionContext=" + sqlTaskExecutionContext + ", dataxTaskExecutionContext=" + dataxTaskExecutionContext + ", dependenceTaskExecutionContext=" + dependenceTaskExecutionContext + ", sqoopTaskExecutionContext=" + sqoopTaskExecutionContext + ", procedureTaskExecutionContext=" + procedureTaskExecutionContext + '}'; } public String getVarPool() { return varPool; } public void setVarPool(String varPool) { this.varPool = varPool; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
/* * 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.dao.mapper; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import java.util.Date; import java.util.List; import org.junit.Assert;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @RunWith(SpringRunner.class) @SpringBootTest @Transactional @Rollback public class TaskInstanceMapperTest { @Autowired TaskInstanceMapper taskInstanceMapper; @Autowired ProcessDefinitionMapper processDefinitionMapper; @Autowired ProcessInstanceMapper processInstanceMapper; @Autowired ProcessInstanceMapMapper processInstanceMapMapper; private int processInstanceId; @Before public void before() { ProcessInstance processInstance = new ProcessInstance(); processInstance.setWarningGroupId(0); processInstance.setCommandParam(""); processInstanceMapper.insert(processInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
processInstanceId = processInstance.getId(); } /** * insert * * @return TaskInstance */ private TaskInstance insertTaskInstance(int processInstanceId) { return insertTaskInstance(processInstanceId, TaskType.SHELL.getDesc()); } /** * insert * * @return ProcessInstance */ private ProcessInstance insertProcessInstance() { ProcessInstance processInstance = new ProcessInstance(); processInstance.setId(1); processInstance.setName("taskName"); processInstance.setState(ExecutionStatus.RUNNING_EXECUTION); processInstance.setStartTime(new Date()); processInstance.setEndTime(new Date()); processInstance.setProcessDefinitionCode(1L); processInstanceMapper.insert(processInstance); return processInstanceMapper.queryByProcessDefineCode(1L,1).get(0); } /** * construct a task instance and then insert */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
private TaskInstance insertTaskInstance(int processInstanceId, String taskType) { TaskInstance taskInstance = new TaskInstance(); taskInstance.setFlag(Flag.YES); taskInstance.setName("us task"); taskInstance.setState(ExecutionStatus.RUNNING_EXECUTION); taskInstance.setStartTime(new Date()); taskInstance.setEndTime(new Date()); taskInstance.setProcessInstanceId(processInstanceId); taskInstance.setTaskType(taskType); taskInstanceMapper.insert(taskInstance); return taskInstance; } /** * test update */ @Test public void testUpdate() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance taskInstance = insertTaskInstance(processInstance.getId()); int update = taskInstanceMapper.updateById(taskInstance); Assert.assertEquals(1, update); taskInstanceMapper.deleteById(taskInstance.getId()); } /** * test delete */ @Test
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
public void testDelete() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance taskInstance = insertTaskInstance(processInstance.getId()); int delete = taskInstanceMapper.deleteById(taskInstance.getId()); Assert.assertEquals(1, delete); } /** * test query */ @Test public void testQuery() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance taskInstance = insertTaskInstance(processInstance.getId()); List<TaskInstance> taskInstances = taskInstanceMapper.selectList(null); taskInstanceMapper.deleteById(taskInstance.getId()); Assert.assertNotEquals(taskInstances.size(), 0); } /** * test query task instance by process instance id and state */ @Test public void testQueryTaskByProcessIdAndState() { ProcessInstance processInstance = insertProcessInstance();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
TaskInstance task = insertTaskInstance(processInstance.getId()); task.setProcessInstanceId(processInstance.getId()); taskInstanceMapper.updateById(task); List<Integer> taskInstances = taskInstanceMapper.queryTaskByProcessIdAndState( task.getProcessInstanceId(), ExecutionStatus.RUNNING_EXECUTION.ordinal() ); taskInstanceMapper.deleteById(task.getId()); Assert.assertNotEquals(taskInstances.size(), 0); } /** * test find valid task list by process instance id */ @Test public void testFindValidTaskListByProcessId() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); TaskInstance task2 = insertTaskInstance(processInstance.getId()); task.setProcessInstanceId(processInstance.getId()); task2.setProcessInstanceId(processInstance.getId()); taskInstanceMapper.updateById(task); taskInstanceMapper.updateById(task2); List<TaskInstance> taskInstances = taskInstanceMapper.findValidTaskListByProcessId( task.getProcessInstanceId(), Flag.YES ); task2.setFlag(Flag.NO); taskInstanceMapper.updateById(task2);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
List<TaskInstance> taskInstances1 = taskInstanceMapper.findValidTaskListByProcessId(task.getProcessInstanceId(), Flag.NO); taskInstanceMapper.deleteById(task2.getId()); taskInstanceMapper.deleteById(task.getId()); Assert.assertNotEquals(taskInstances.size(), 0); Assert.assertNotEquals(taskInstances1.size(), 0); } /** * test query by host and status */ @Test public void testQueryByHostAndStatus() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); task.setHost("111.111.11.11"); taskInstanceMapper.updateById(task); List<TaskInstance> taskInstances = taskInstanceMapper.queryByHostAndStatus( task.getHost(), new int[]{ExecutionStatus.RUNNING_EXECUTION.ordinal()} ); taskInstanceMapper.deleteById(task.getId()); Assert.assertNotEquals(taskInstances.size(), 0); } /** * test set failover by host and state array */ @Test public void testSetFailoverByHostAndStateArray() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); task.setHost("111.111.11.11"); taskInstanceMapper.updateById(task); int setResult = taskInstanceMapper.setFailoverByHostAndStateArray( task.getHost(), new int[]{ExecutionStatus.RUNNING_EXECUTION.ordinal()}, ExecutionStatus.NEED_FAULT_TOLERANCE ); taskInstanceMapper.deleteById(task.getId()); Assert.assertNotEquals(setResult, 0); } /** * test query by task instance id and name */ @Test public void testQueryByInstanceIdAndName() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); task.setHost("111.111.11.11"); taskInstanceMapper.updateById(task); TaskInstance taskInstance = taskInstanceMapper.queryByInstanceIdAndName( task.getProcessInstanceId(), task.getName() ); taskInstanceMapper.deleteById(task.getId()); Assert.assertNotEquals(taskInstance, null);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
} /** * test count task instance */ @Test public void testCountTask() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); ProcessDefinition definition = new ProcessDefinition(); definition.setCode(1L); definition.setProjectCode(1111L); definition.setCreateTime(new Date()); definition.setUpdateTime(new Date()); processDefinitionMapper.insert(definition); taskInstanceMapper.updateById(task); int countTask = taskInstanceMapper.countTask( new Long[0], new int[0] ); int countTask2 = taskInstanceMapper.countTask( new Long[]{definition.getProjectCode()}, new int[]{task.getId()} ); taskInstanceMapper.deleteById(task.getId()); processDefinitionMapper.deleteById(definition.getId()); Assert.assertEquals(countTask, 0); Assert.assertEquals(countTask2, 0);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
} /** * test count task instance state by user */ @Test public void testCountTaskInstanceStateByUser() { ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); ProcessDefinition definition = new ProcessDefinition(); definition.setCode(1111L); definition.setProjectCode(1111L); definition.setCreateTime(new Date()); definition.setUpdateTime(new Date()); processDefinitionMapper.insert(definition); taskInstanceMapper.updateById(task); List<ExecuteStatusCount> count = taskInstanceMapper.countTaskInstanceStateByUser( null, null, new Long[]{definition.getProjectCode()} ); processDefinitionMapper.deleteById(definition.getId()); taskInstanceMapper.deleteById(task.getId()); } /** * test page */ @Test public void testQueryTaskInstanceListPaging() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,336
[Bug] [UT] UT failed in DAO module
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When I run the UT in `TaskInstanceMapperTest`, it failed. The `process_definition_code` is null. ```java ### SQL: INSERT INTO t_ds_process_instance ( warning_group_id, timeout, executor_id, max_try_times, tenant_id, command_param, run_times, process_definition_version ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ; Field 'process_definition_code' doesn't have a default value; nested exception is java.sql.SQLException: Field 'process_definition_code' doesn't have a default value ``` ### What you expected to happen UT execute success. ### How to reproduce Execute TaskInstanceMapperTest. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6336
https://github.com/apache/dolphinscheduler/pull/6435
ea2a8d26a0d42683309b8bda9ef24f4daaab266b
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
"2021-09-24T10:36:04Z"
java
"2021-10-03T15:25:06Z"
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
ProcessDefinition definition = new ProcessDefinition(); definition.setCode(1L); definition.setProjectCode(1111L); definition.setCreateTime(new Date()); definition.setUpdateTime(new Date()); processDefinitionMapper.insert(definition); ProcessInstance processInstance = insertProcessInstance(); TaskInstance task = insertTaskInstance(processInstance.getId()); Page<TaskInstance> page = new Page(1, 3); IPage<TaskInstance> taskInstanceIPage = taskInstanceMapper.queryTaskInstanceListPaging( page, definition.getProjectCode(), task.getProcessInstanceId(), "", "", "", 0, new int[0], "", null, null ); processInstanceMapper.deleteById(processInstance.getId()); taskInstanceMapper.deleteById(task.getId()); processDefinitionMapper.deleteById(definition.getId()); Assert.assertEquals(taskInstanceIPage.getTotal(), 0); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,445
[Improvement][Standalone] Run h2 in daemon mode
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In standalone, we use h2 as the database. If the creation table sql is wrong, it will throw an exception, but the server will keep running. It's better to stop. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6445
https://github.com/apache/dolphinscheduler/pull/6446
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
6529f92883dfd62cdc7241acba8cb16e4fa60a36
"2021-10-04T02:00:47Z"
java
"2021-10-06T02:15:36Z"
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
/* * 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.server; import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME; import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_PASSWORD;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,445
[Improvement][Standalone] Run h2 in daemon mode
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In standalone, we use h2 as the database. If the creation table sql is wrong, it will throw an exception, but the server will keep running. It's better to stop. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6445
https://github.com/apache/dolphinscheduler/pull/6446
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
6529f92883dfd62cdc7241acba8cb16e4fa60a36
"2021-10-04T02:00:47Z"
java
"2021-10-06T02:15:36Z"
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_URL; import static org.apache.dolphinscheduler.common.Constants.SPRING_DATASOURCE_USERNAME; import org.apache.dolphinscheduler.alert.AlertServer; import org.apache.dolphinscheduler.api.ApiApplicationServer; import org.apache.dolphinscheduler.common.utils.ScriptRunner; import org.apache.dolphinscheduler.dao.datasource.ConnectionFactory; import org.apache.dolphinscheduler.server.master.MasterServer; import org.apache.dolphinscheduler.server.worker.WorkerServer; import org.apache.curator.test.TestingServer; import java.io.FileReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.sql.SQLException; import javax.sql.DataSource; import org.h2.tools.Server; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @SpringBootApplication public class StandaloneServer { private static final Logger LOGGER = LoggerFactory.getLogger(StandaloneServer.class); public static void main(String[] args) throws Exception { Thread.currentThread().setName("Standalone-Server"); System.setProperty("spring.profiles.active", "api"); startDatabase(); startRegistry(); startAlertServer();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,445
[Improvement][Standalone] Run h2 in daemon mode
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In standalone, we use h2 as the database. If the creation table sql is wrong, it will throw an exception, but the server will keep running. It's better to stop. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6445
https://github.com/apache/dolphinscheduler/pull/6446
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
6529f92883dfd62cdc7241acba8cb16e4fa60a36
"2021-10-04T02:00:47Z"
java
"2021-10-06T02:15:36Z"
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
setTaskPlugin(); new SpringApplicationBuilder( ApiApplicationServer.class, MasterServer.class, WorkerServer.class ).run(args); } private static void startAlertServer() { final Path alertPluginPath = Paths.get( StandaloneServer.class.getProtectionDomain().getCodeSource().getLocation().getPath(), "../../../dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/pom.xml" ).toAbsolutePath(); if (Files.exists(alertPluginPath)) { System.setProperty("alert.plugin.binding", alertPluginPath.toString()); System.setProperty("alert.plugin.dir", ""); } AlertServer.getInstance().start(); } private static void startRegistry() throws Exception { final TestingServer server = new TestingServer(true); System.setProperty("registry.servers", server.getConnectString()); final Path registryPath = Paths.get( StandaloneServer.class.getProtectionDomain().getCodeSource().getLocation().getPath(), "../../../dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/pom.xml" ).toAbsolutePath(); if (Files.exists(registryPath)) { System.setProperty("registry.plugin.binding", registryPath.toString()); System.setProperty("registry.plugin.dir", ""); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,445
[Improvement][Standalone] Run h2 in daemon mode
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In standalone, we use h2 as the database. If the creation table sql is wrong, it will throw an exception, but the server will keep running. It's better to stop. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6445
https://github.com/apache/dolphinscheduler/pull/6446
4fbee7dc4b178b13c4a795fa848a86ec94c5cd27
6529f92883dfd62cdc7241acba8cb16e4fa60a36
"2021-10-04T02:00:47Z"
java
"2021-10-06T02:15:36Z"
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/server/StandaloneServer.java
private static void startDatabase() throws IOException, SQLException { final Path temp = Files.createTempDirectory("dolphinscheduler_"); LOGGER.info("H2 database directory: {}", temp); System.setProperty( SPRING_DATASOURCE_DRIVER_CLASS_NAME, org.h2.Driver.class.getName() ); System.setProperty( SPRING_DATASOURCE_URL, String.format("jdbc:h2:tcp://localhost/%s;MODE=MySQL;DATABASE_TO_LOWER=true", temp.toAbsolutePath()) ); System.setProperty(SPRING_DATASOURCE_USERNAME, "sa"); System.setProperty(SPRING_DATASOURCE_PASSWORD, ""); Server.createTcpServer("-ifNotExists").start(); final DataSource ds = ConnectionFactory.getInstance().getDataSource(); final ScriptRunner runner = new ScriptRunner(ds.getConnection(), true, true); runner.runScript(new FileReader("sql/dolphinscheduler_h2.sql")); } private static void setTaskPlugin() { final Path taskPluginPath = Paths.get( StandaloneServer.class.getProtectionDomain().getCodeSource().getLocation().getPath(), "../../../dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml" ).toAbsolutePath(); if (Files.exists(taskPluginPath)) { System.setProperty("task.plugin.binding", taskPluginPath.toString()); System.setProperty("task.plugin.dir", ""); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java
/* * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java
* * 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.server.master.processor; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.StateEvent; import org.apache.dolphinscheduler.common.enums.StateEventType; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; import org.apache.dolphinscheduler.server.master.processor.queue.StateEventResponseService; import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import java.util.concurrent.ConcurrentHashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import io.netty.channel.Channel; /** * handle state event received from master/api */ public class StateEventProcessor implements NettyRequestProcessor {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/processor/StateEventProcessor.java
private final Logger logger = LoggerFactory.getLogger(StateEventProcessor.class); private StateEventResponseService stateEventResponseService; public StateEventProcessor() { stateEventResponseService = SpringApplicationContext.getBean(StateEventResponseService.class); } public void init(ConcurrentHashMap<Integer, WorkflowExecuteThread> processInstanceExecMaps) { this.stateEventResponseService.init(processInstanceExecMaps); } @Override public void process(Channel channel, Command command) { Preconditions.checkArgument(CommandType.STATE_EVENT_REQUEST == command.getType(), String.format("invalid command type: %s", command.getType())); StateEventChangeCommand stateEventChangeCommand = JSONUtils.parseObject(command.getBody(), StateEventChangeCommand.class); StateEvent stateEvent = new StateEvent(); stateEvent.setExecutionStatus(ExecutionStatus.RUNNING_EXECUTION); stateEvent.setKey(stateEventChangeCommand.getKey()); stateEvent.setProcessInstanceId(stateEventChangeCommand.getDestProcessInstanceId()); stateEvent.setTaskInstanceId(stateEventChangeCommand.getDestTaskInstanceId()); StateEventType type = stateEvent.getTaskInstanceId() == 0 ? StateEventType.PROCESS_STATE_CHANGE : StateEventType.TASK_STATE_CHANGE; stateEvent.setType(type); logger.info("received command : {}", stateEvent); stateEventResponseService.addResponse(stateEvent); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/* * Lcensed to the Apache Software Foundaton (ASF) under one or more * contrbutor lcense agreements. See the NOTICE fle dstrbuted wth * ths work for addtonal nformaton regardng copyrght ownershp. * The ASF lcenses ths fle to You under the Apache Lcense, Verson 2.0 * (the "Lcense"); you may not use ths fle except n complance wth * the Lcense. You may obtan a copy of the Lcense at * * http://www.apache.org/lcenses/LICENSE-2.0 *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* Unless requred by applcable law or agreed to n wrtng, software * dstrbuted under the Lcense s dstrbuted on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ether express or mpled. * See the Lcense for the specfc language governng permssons and * lmtatons under the Lcense. */ package org.apache.dolphnscheduler.server.master.runner; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_START_NODE_NAMES; mport statc org.apache.dolphnscheduler.common.Constants.DEFAULT_WORKER_GROUP; mport statc org.apache.dolphnscheduler.common.Constants.SEC_2_MINUTES_TIME_UNIT; mport org.apache.dolphnscheduler.common.Constants; mport org.apache.dolphnscheduler.common.enums.CommandType; mport org.apache.dolphnscheduler.common.enums.DependResult; mport org.apache.dolphnscheduler.common.enums.Drect; mport org.apache.dolphnscheduler.common.enums.ExecutonStatus; mport org.apache.dolphnscheduler.common.enums.FalureStrategy; mport org.apache.dolphnscheduler.common.enums.Flag; mport org.apache.dolphnscheduler.common.enums.Prorty; mport org.apache.dolphnscheduler.common.enums.StateEvent; mport org.apache.dolphnscheduler.common.enums.StateEventType; mport org.apache.dolphnscheduler.common.enums.TaskDependType; mport org.apache.dolphnscheduler.common.enums.TaskTmeoutStrategy; mport org.apache.dolphnscheduler.common.enums.TmeoutFlag; mport org.apache.dolphnscheduler.common.graph.DAG; mport org.apache.dolphnscheduler.common.model.TaskNode; mport org.apache.dolphnscheduler.common.model.TaskNodeRelaton; mport org.apache.dolphnscheduler.common.process.ProcessDag;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport org.apache.dolphnscheduler.common.process.Property; mport org.apache.dolphnscheduler.common.thread.ThreadUtls; mport org.apache.dolphnscheduler.common.utls.CollectonUtls; mport org.apache.dolphnscheduler.common.utls.DateUtls; mport org.apache.dolphnscheduler.common.utls.JSONUtls; mport org.apache.dolphnscheduler.common.utls.NetUtls; mport org.apache.dolphnscheduler.common.utls.ParameterUtls; mport org.apache.dolphnscheduler.dao.entty.Envronment; mport org.apache.dolphnscheduler.dao.entty.ProcessDefnton; mport org.apache.dolphnscheduler.dao.entty.ProcessInstance; mport org.apache.dolphnscheduler.dao.entty.ProjectUser; mport org.apache.dolphnscheduler.dao.entty.Schedule; mport org.apache.dolphnscheduler.dao.entty.TaskDefnton; mport org.apache.dolphnscheduler.dao.entty.TaskInstance; mport org.apache.dolphnscheduler.dao.utls.DagHelper; mport org.apache.dolphnscheduler.remote.command.HostUpdateCommand; mport org.apache.dolphnscheduler.remote.utls.Host; mport org.apache.dolphnscheduler.server.master.confg.MasterConfg; mport org.apache.dolphnscheduler.server.master.dspatch.executor.NettyExecutorManager; mport org.apache.dolphnscheduler.server.master.runner.task.ITaskProcessor; mport org.apache.dolphnscheduler.server.master.runner.task.TaskActon; mport org.apache.dolphnscheduler.server.master.runner.task.TaskProcessorFactory; mport org.apache.dolphnscheduler.servce.alert.ProcessAlertManager; mport org.apache.dolphnscheduler.servce.process.ProcessServce; mport org.apache.dolphnscheduler.servce.quartz.cron.CronUtls; mport org.apache.dolphnscheduler.servce.queue.PeerTaskInstancePrortyQueue; mport org.apache.commons.lang.StrngUtls; mport java.utl.ArrayLst; mport java.utl.Arrays; mport java.utl.Collecton;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport java.utl.Date; mport java.utl.HashMap; mport java.utl.Iterator; mport java.utl.Lst; mport java.utl.Map; mport java.utl.Objects; mport java.utl.Set; mport java.utl.concurrent.ConcurrentHashMap; mport java.utl.concurrent.ConcurrentLnkedQueue; mport java.utl.concurrent.ExecutorServce; mport org.slf4j.Logger; mport org.slf4j.LoggerFactory; mport com.google.common.collect.HashBasedTable; mport com.google.common.collect.Lsts; mport com.google.common.collect.Table; /** * master exec thread,splt dag */ publc class WorkflowExecuteThread mplements Runnable { /** * logger of WorkflowExecuteThread */ prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteThread.class); /** * runng TaskNode */ prvate fnal Map<Integer, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>(); /** * task exec servce */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate fnal ExecutorServce taskExecServce; /** * process nstance */ prvate ProcessInstance processInstance; /** * submt falure nodes */ prvate boolean taskFaledSubmt = false; /** * recover node d lst */ prvate Lst<TaskInstance> recoverNodeIdLst = new ArrayLst<>(); /** * error task lst */ prvate Map<Strng, TaskInstance> errorTaskLst = new ConcurrentHashMap<>(); /** * complete task lst */ prvate Map<Strng, TaskInstance> completeTaskLst = new ConcurrentHashMap<>(); /** * ready to submt task queue */ prvate PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue(); /** * depend faled task map */ prvate Map<Strng, TaskInstance> dependFaledTask = new ConcurrentHashMap<>(); /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* forbdden task map */ prvate Map<Strng, TaskNode> forbddenTaskLst = new ConcurrentHashMap<>(); /** * skp task map */ prvate Map<Strng, TaskNode> skpTaskNodeLst = new ConcurrentHashMap<>(); /** * recover tolerance fault task lst */ prvate Lst<TaskInstance> recoverToleranceFaultTaskLst = new ArrayLst<>(); /** * alert manager */ prvate ProcessAlertManager processAlertManager; /** * the object of DAG */ prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag; /** * process servce */ prvate ProcessServce processServce; /** * master confg */ prvate MasterConfg masterConfg; /** * */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate NettyExecutorManager nettyExecutorManager; prvate ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>(); prvate Lst<Date> complementLstDate = Lsts.newLnkedLst(); prvate Table<Integer, Long, TaskInstance> taskInstanceHashMap = HashBasedTable.create(); prvate ProcessDefnton processDefnton; prvate Strng key; prvate ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst; /** * start flag, true: start nodes submt completely * */ prvate boolean sStart = false; /** * constructor of WorkflowExecuteThread * * @param processInstance processInstance * @param processServce processServce * @param nettyExecutorManager nettyExecutorManager * @param taskTmeoutCheckLst */ publc WorkflowExecuteThread(ProcessInstance processInstance , ProcessServce processServce , NettyExecutorManager nettyExecutorManager , ProcessAlertManager processAlertManager , MasterConfg masterConfg , ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst) { ths.processServce = processServce; ths.processInstance = processInstance; ths.masterConfg = masterConfg; nt masterTaskExecNum = masterConfg.getMasterExecTaskNum();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
ths.taskExecServce = ThreadUtls.newDaemonFxedThreadExecutor("Master-Task-Exec-Thread", masterTaskExecNum); ths.nettyExecutorManager = nettyExecutorManager; ths.processAlertManager = processAlertManager; ths.taskTmeoutCheckLst = taskTmeoutCheckLst; } @Overrde publc vod run() { try { startProcess(); handleEvents(); } catch (Excepton e) { logger.error("handler error:", e); } } /** * the process start nodes are submtted completely. * @return */ publc boolean sStart() { return ths.sStart; } prvate vod handleEvents() { whle (ths.stateEvents.sze() > 0) { try { StateEvent stateEvent = ths.stateEvents.peek(); f (stateEventHandler(stateEvent)) { ths.stateEvents.remove(stateEvent); } } catch (Excepton e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.error("state handle error:", e); } } } publc Strng getKey() { f (StrngUtls.sNotEmpty(key) || ths.processDefnton == null) { return key; } key = Strng.format("%d_%d_%d", ths.processDefnton.getCode(), ths.processDefnton.getVerson(), ths.processInstance.getId()); return key; } publc boolean addStateEvent(StateEvent stateEvent) { f (processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.nfo("state event would be abounded :{}", stateEvent.toStrng()); return false; } ths.stateEvents.add(stateEvent); return true; } publc nt eventSze() { return ths.stateEvents.sze(); } publc ProcessInstance getProcessInstance() { return ths.processInstance; } prvate boolean stateEventHandler(StateEvent stateEvent) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.nfo("process event: {}", stateEvent.toStrng()); f (!checkStateEvent(stateEvent)) { return false; } boolean result = false; swtch (stateEvent.getType()) { case PROCESS_STATE_CHANGE: result = processStateChangeHandler(stateEvent); break; case TASK_STATE_CHANGE: result = taskStateChangeHandler(stateEvent); break; case PROCESS_TIMEOUT: result = processTmeout(); break; case TASK_TIMEOUT: result = taskTmeout(stateEvent); break; default: break; } f (result) { ths.stateEvents.remove(stateEvent); } return result; } prvate boolean taskTmeout(StateEvent stateEvent) { f (taskInstanceHashMap.contansRow(stateEvent.getTaskInstanceId())) { return true; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
TaskInstance taskInstance = taskInstanceHashMap .row(stateEvent.getTaskInstanceId()) .values() .terator().next(); f (TmeoutFlag.CLOSE == taskInstance.getTaskDefne().getTmeoutFlag()) { return true; } TaskTmeoutStrategy taskTmeoutStrategy = taskInstance.getTaskDefne().getTmeoutNotfyStrategy(); f (TaskTmeoutStrategy.FAILED == taskTmeoutStrategy) { ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); taskProcessor.acton(TaskActon.TIMEOUT); return false; } else { processAlertManager.sendTaskTmeoutAlert(processInstance, taskInstance, taskInstance.getTaskDefne()); return true; } } prvate boolean processTmeout() { ths.processAlertManager.sendProcessTmeoutAlert(ths.processInstance, ths.processDefnton); return true; } prvate boolean taskStateChangeHandler(StateEvent stateEvent) { TaskInstance task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId()); f (stateEvent.getExecutonStatus().typeIsFnshed()) { taskFnshed(task); } else f (actveTaskProcessorMaps.contansKey(stateEvent.getTaskInstanceId())) { ITaskProcessor TaskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); TaskProcessor.run(); f (TaskProcessor.taskState().typeIsFnshed()) { task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
taskFnshed(task); } } else { logger.error("state handler error: {}", stateEvent.toStrng()); } return true; } prvate vod taskFnshed(TaskInstance task) { logger.nfo("work flow {} task {} state:{} ", processInstance.getId(), task.getId(), task.getState()); f (task.taskCanRetry()) { addTaskToStandByLst(task); return; } ProcessInstance processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); completeTaskLst.put(Long.toStrng(task.getTaskCode()), task); actveTaskProcessorMaps.remove(task.getId()); taskTmeoutCheckLst.remove(task.getId()); f (task.getState().typeIsSuccess()) { processInstance.setVarPool(task.getVarPool()); processServce.saveProcessInstance(processInstance); submtPostNode(Long.toStrng(task.getTaskCode())); } else f (task.getState().typeIsFalure()) { f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) { submtPostNode(Long.toStrng(task.getTaskCode())); } else { errorTaskLst.put(Long.toStrng(task.getTaskCode()), task);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (processInstance.getFalureStrategy() == FalureStrategy.END) { kllAllTasks(); } } } ths.updateProcessInstanceState(); } prvate boolean checkStateEvent(StateEvent stateEvent) { f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.error("msmatch process nstance d: {}, state event:{}", ths.processInstance.getId(), stateEvent.toStrng()); return false; } return true; } prvate boolean processStateChangeHandler(StateEvent stateEvent) { try { logger.nfo("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutonStatus()); processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); f (processComplementData()) { return true; } f (stateEvent.getExecutonStatus().typeIsFnshed()) { endProcess(); } f (stateEvent.getExecutonStatus() == ExecutonStatus.READY_STOP) { kllAllTasks(); } return true;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} catch (Excepton e) { logger.error("process state change error:", e); } return true; } prvate boolean processComplementData() throws Excepton { f (!needComplementProcess()) { return false; } Date scheduleDate = processInstance.getScheduleTme(); f (scheduleDate == null) { scheduleDate = complementLstDate.get(0); } else f (processInstance.getState().typeIsFnshed()) { endProcess(); f (complementLstDate.sze() <= 0) { logger.nfo("process complement end. process d:{}", processInstance.getId()); return true; } nt ndex = complementLstDate.ndexOf(scheduleDate); f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().typeIsSuccess()) { logger.nfo("process complement end. process d:{}", processInstance.getId()); return true; } logger.nfo("process complement contnue. process d:{}, schedule tme:{} complementLstDate:{}", processInstance.getId(), processInstance.getScheduleTme(), complementLstDate.toStrng()); scheduleDate = complementLstDate.get(ndex + 1);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
processInstance.setId(0); } processInstance.setScheduleTme(scheduleDate); Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam.contansKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); processInstance.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); } processInstance.setState(ExecutonStatus.RUNNING_EXECUTION); processInstance.setGlobalParams(ParameterUtls.curngGlobalParams( processDefnton.getGlobalParamMap(), processDefnton.getGlobalParamLst(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme())); processInstance.setStartTme(new Date()); processInstance.setEndTme(null); processServce.saveProcessInstance(processInstance); ths.taskInstanceHashMap.clear(); startProcess(); return true; } prvate boolean needComplementProcess() { f (processInstance.sComplementData() && Flag.NO == processInstance.getIsSubProcess()) { return true; } return false; } prvate vod startProcess() throws Excepton { f (ths.taskInstanceHashMap.sze() == 0) { sStart = false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
buldFlowDag(); ntTaskQueue(); submtPostNode(null); sStart = true; } } /** * process end handle */ prvate vod endProcess() { ths.stateEvents.clear(); processInstance.setEndTme(new Date()); processServce.updateProcessInstance(processInstance); f (processInstance.getState().typeIsWatngThread()) { processServce.createRecoveryWatngThreadCommand(null, processInstance); } Lst<TaskInstance> taskInstances = processServce.fndValdTaskLstByProcessId(processInstance.getId()); ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendAlertProcessInstance(processInstance, taskInstances, projectUser); } /** * generate process dag * * @throws Excepton excepton */ prvate vod buldFlowDag() throws Excepton { f (ths.dag != null) { return; } processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
processInstance.getProcessDefntonVerson()); recoverNodeIdLst = getStartTaskInstanceLst(processInstance.getCommandParam()); Lst<TaskNode> taskNodeLst = processServce.transformTask(processServce.fndRelatonByCode(processDefnton.getProjectCode(), processDefnton.getCode()), Lsts.newArrayLst()); forbddenTaskLst.clear(); taskNodeLst.forEach(taskNode -> { f (taskNode.sForbdden()) { forbddenTaskLst.put(Long.toStrng(taskNode.getCode()), taskNode); } }); Lst<Strng> recoveryNodeCodeLst = getRecoveryNodeCodeLst(); Lst<Strng> startNodeNameLst = parseStartNodeName(processInstance.getCommandParam()); ProcessDag processDag = generateFlowDag(taskNodeLst, startNodeNameLst, recoveryNodeCodeLst, processInstance.getTaskDependType()); f (processDag == null) { logger.error("processDag s null"); return; } dag = DagHelper.buldDagGraph(processDag); } /** * nt task queue */ prvate vod ntTaskQueue() { taskFaledSubmt = false; actveTaskProcessorMaps.clear(); dependFaledTask.clear(); completeTaskLst.clear();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
errorTaskLst.clear(); Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(processInstance.getId()); for (TaskInstance task : taskInstanceLst) { f (task.sTaskComplete()) { completeTaskLst.put(Long.toStrng(task.getTaskCode()), task); } f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) { contnue; } f (task.getState().typeIsFalure() && !task.taskCanRetry()) { errorTaskLst.put(Long.toStrng(task.getTaskCode()), task); } } f (processInstance.sComplementData() && complementLstDate.sze() == 0) { Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam != null && cmdParam.contansKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) { Date start = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Date end = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode(processInstance.getProcessDefntonCode()); f (complementLstDate.sze() == 0 && needComplementProcess()) { complementLstDate = CronUtls.getSelfFreDateLst(start, end, schedules); logger.nfo(" process defnton code:{} complement data: {}", processInstance.getProcessDefntonCode(), complementLstDate.toStrng()); } } } } /** * submt task to execute *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @param taskInstance task nstance * @return TaskInstance */ prvate TaskInstance submtTaskExec(TaskInstance taskInstance) { try { ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType()); f (taskInstance.getState() == ExecutonStatus.RUNNING_EXECUTION && taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) { notfyProcessHostUpdate(taskInstance); } boolean submt = taskProcessor.submt(taskInstance, processInstance, masterConfg.getMasterTaskCommtRetryTmes(), masterConfg.getMasterTaskCommtInterval()); f (submt) { ths.taskInstanceHashMap.put(taskInstance.getId(), taskInstance.getTaskCode(), taskInstance); actveTaskProcessorMaps.put(taskInstance.getId(), taskProcessor); taskProcessor.run(); addTmeoutCheck(taskInstance); TaskDefnton taskDefnton = processServce.fndTaskDefnton( taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson()); taskInstance.setTaskDefne(taskDefnton); f (taskProcessor.taskState().typeIsFnshed()) { StateEvent stateEvent = new StateEvent(); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setExecutonStatus(taskProcessor.taskState()); stateEvent.setType(StateEventType.TASK_STATE_CHANGE); ths.stateEvents.add(stateEvent); } return taskInstance; } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.error("process d:{} name:{} submt standby task d:{} name:{} faled!", processInstance.getId(), processInstance.getName(), taskInstance.getId(), taskInstance.getName()); return null; } } catch (Excepton e) { logger.error("submt standby task error", e); return null; } } prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) { f (StrngUtls.sEmpty(taskInstance.getHost())) { return; } try { HostUpdateCommand hostUpdateCommand = new HostUpdateCommand(); hostUpdateCommand.setProcessHost(NetUtls.getAddr(masterConfg.getLstenPort())); hostUpdateCommand.setTaskInstanceId(taskInstance.getId()); Host host = new Host(taskInstance.getHost()); nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command()); } catch (Excepton e) { logger.error("notfy process host update", e); } } prvate vod addTmeoutCheck(TaskInstance taskInstance) { TaskDefnton taskDefnton = processServce.fndTaskDefnton( taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson() ); taskInstance.setTaskDefne(taskDefnton);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (TmeoutFlag.OPEN == taskDefnton.getTmeoutFlag()) { ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance); return; } f (taskInstance.sDependTask() || taskInstance.sSubProcess()) { ths.taskTmeoutCheckLst.put(taskInstance.getId(), taskInstance); } } /** * fnd task nstance n db. * n case submt more than one same name task n the same tme. * * @param taskCode task code * @param taskVerson task verson * @return TaskInstance */ prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) { Lst<TaskInstance> taskInstanceLst = processServce.fndValdTaskLstByProcessId(ths.processInstance.getId()); for (TaskInstance taskInstance : taskInstanceLst) { f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) { return taskInstance; } } return null; } /** * encapsulaton task * * @param processInstance process nstance * @param taskNode taskNode
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @return TaskInstance */ prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) { TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson()); f (taskInstance == null) { taskInstance = new TaskInstance(); taskInstance.setTaskCode(taskNode.getCode()); taskInstance.setTaskDefntonVerson(taskNode.getVerson()); taskInstance.setName(taskNode.getName()); taskInstance.setState(ExecutonStatus.SUBMITTED_SUCCESS); taskInstance.setProcessInstanceId(processInstance.getId()); taskInstance.setTaskType(taskNode.getType().toUpperCase()); taskInstance.setAlertFlag(Flag.NO); taskInstance.setStartTme(null); taskInstance.setFlag(Flag.YES); taskInstance.setDryRun(processInstance.getDryRun()); taskInstance.setRetryTmes(0); taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes()); taskInstance.setRetryInterval(taskNode.getRetryInterval());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
taskInstance.setTaskParams(taskNode.getTaskParams()); f (taskNode.getTaskInstanceProrty() == null) { taskInstance.setTaskInstanceProrty(Prorty.MEDIUM); } else { taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty()); } Strng processWorkerGroup = processInstance.getWorkerGroup(); processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup; Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup(); Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode(); Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode(); f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { taskInstance.setWorkerGroup(processWorkerGroup); taskInstance.setEnvronmentCode(processEnvronmentCode); } else { taskInstance.setWorkerGroup(taskWorkerGroup); taskInstance.setEnvronmentCode(taskEnvronmentCode); } f (!taskInstance.getEnvronmentCode().equals(-1L)) { Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode()); f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) { taskInstance.setEnvronmentConfg(envronment.getConfg()); } } taskInstance.setDelayTme(taskNode.getDelayTme()); } return taskInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) { Map<Strng, Property> allProperty = new HashMap<>(); Map<Strng, TaskInstance> allTaskInstance = new HashMap<>(); f (CollectonUtls.sNotEmpty(preTask)) { for (Strng preTaskName : preTask) { TaskInstance preTaskInstance = completeTaskLst.get(preTaskName); f (preTaskInstance == null) { contnue; } Strng preVarPool = preTaskInstance.getVarPool(); f (StrngUtls.sNotEmpty(preVarPool)) { Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class); for (Property nfo : propertes) { setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo); } } } f (allProperty.sze() > 0) { taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values())); } } } prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) { thsProperty.setDrect(Drect.IN); Strng proName = thsProperty.getProp(); f (allProperty.contansKey(proName)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
Property otherPro = allProperty.get(proName); f (StrngUtls.sEmpty(thsProperty.getValue())) { allProperty.put(proName, otherPro); } else f (StrngUtls.sNotEmpty(otherPro.getValue())) { TaskInstance otherTask = allTaskInstance.get(proName); f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } else { allProperty.put(proName, otherPro); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } prvate vod submtPostNode(Strng parentNodeCode) { Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeCode, skpTaskNodeLst, dag, completeTaskLst); Lst<TaskInstance> taskInstances = new ArrayLst<>(); for (Strng taskNode : submtTaskNodeLst) { TaskNode taskNodeObject = dag.getNode(taskNode); f (taskInstanceHashMap.contansColumn(taskNodeObject.getCode())) { contnue;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} TaskInstance task = createTaskInstance(processInstance, taskNodeObject); taskInstances.add(task); } for (TaskInstance task : taskInstances) { f (readyToSubmtTaskQueue.contans(task)) { contnue; } f (completeTaskLst.contansKey(Long.toStrng(task.getTaskCode()))) { logger.nfo("task {} has already run success", task.getName()); contnue; } f (task.getState().typeIsPause() || task.getState().typeIsCancel()) { logger.nfo("task {} stopped, the state s {}", task.getName(), task.getState()); } else { addTaskToStandByLst(task); } } submtStandByTask(); updateProcessInstanceState(); } /** * determne whether the dependences of the task node are complete * * @return DependResult */ prvate DependResult sTaskDepsComplete(Strng taskCode) { Collecton<Strng> startNodes = dag.getBegnNode();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (startNodes.contans(taskCode)) { return DependResult.SUCCESS; } TaskNode taskNode = dag.getNode(taskCode); Lst<Strng> depCodeLst = taskNode.getDepLst(); for (Strng depsNode : depCodeLst) { f (!dag.contansNode(depsNode) || forbddenTaskLst.contansKey(depsNode) || skpTaskNodeLst.contansKey(depsNode)) { contnue; } f (!completeTaskLst.contansKey(depsNode)) { return DependResult.WAITING; } ExecutonStatus depTaskState = completeTaskLst.get(depsNode).getState(); f (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) { return DependResult.NON_EXEC; } f (taskNode.sCondtonsTask()) { contnue; } f (!dependTaskSuccess(depsNode, taskCode)) { return DependResult.FAILED; } } logger.nfo("taskCode: {} completeDependTaskLst: {}", taskCode, Arrays.toStrng(completeTaskLst.keySet().toArray())); return DependResult.SUCCESS; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * depend node s completed, but here need check the condton task branch s the next node */ prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) { f (dag.getNode(dependNodeName).sCondtonsTask()) { Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeLst, dag, completeTaskLst); f (!nextTaskLst.contans(nextNodeName)) { return false; } } else { ExecutonStatus depTaskState = completeTaskLst.get(dependNodeName).getState(); f (depTaskState.typeIsFalure()) { return false; } } return true; } /** * query task nstance by complete state * * @param state state * @return task nstance lst */ prvate Lst<TaskInstance> getCompleteTaskByState(ExecutonStatus state) { Lst<TaskInstance> resultLst = new ArrayLst<>(); for (Map.Entry<Strng, TaskInstance> entry : completeTaskLst.entrySet()) { f (entry.getValue().getState() == state) { resultLst.add(entry.getValue()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} return resultLst; } /** * where there are ongong tasks * * @param state state * @return ExecutonStatus */ prvate ExecutonStatus runnngState(ExecutonStatus state) { f (state == ExecutonStatus.READY_STOP || state == ExecutonStatus.READY_PAUSE || state == ExecutonStatus.WAITING_THREAD || state == ExecutonStatus.DELAY_EXECUTION) { return state; } else { return ExecutonStatus.RUNNING_EXECUTION; } } /** * exsts falure task,contans submt falure、dependency falure,execute falure(retry after) * * @return Boolean whether has faled task */ prvate boolean hasFaledTask() { f (ths.taskFaledSubmt) { return true; } f (ths.errorTaskLst.sze() > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return true; } return ths.dependFaledTask.sze() > 0; } /** * process nstance falure * * @return Boolean whether process nstance faled */ prvate boolean processFaled() { f (hasFaledTask()) { f (processInstance.getFalureStrategy() == FalureStrategy.END) { return true; } f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE) { return readyToSubmtTaskQueue.sze() == 0 || actveTaskProcessorMaps.sze() == 0; } } return false; } /** * whether task for watng thread * * @return Boolean whether has watng thread task */ prvate boolean hasWatngThreadTask() { Lst<TaskInstance> watngLst = getCompleteTaskByState(ExecutonStatus.WAITING_THREAD); return CollectonUtls.sNotEmpty(watngLst); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* prepare for pause * 1,faled retry task n the preparaton queue , returns to falure drectly * 2,exsts pause task,complement not completed, pendng submsson of tasks, return to suspenson * 3,success * * @return ExecutonStatus */ prvate ExecutonStatus processReadyPause() { f (hasRetryTaskInStandBy()) { return ExecutonStatus.FAILURE; } Lst<TaskInstance> pauseLst = getCompleteTaskByState(ExecutonStatus.PAUSE); f (CollectonUtls.sNotEmpty(pauseLst) || !sComplementEnd() || readyToSubmtTaskQueue.sze() > 0) { return ExecutonStatus.PAUSE; } else { return ExecutonStatus.SUCCESS; } } /** * generate the latest process nstance status by the tasks state * * @param nstance * @return process nstance executon status */ prvate ExecutonStatus getProcessInstanceState(ProcessInstance nstance) { ExecutonStatus state = nstance.getState(); f (actveTaskProcessorMaps.sze() > 0 || hasRetryTaskInStandBy()) { // actve
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return runnngState(state); } // process falure f (processFaled()) { return ExecutonStatus.FAILURE; } // watng thread f (hasWatngThreadTask()) { return ExecutonStatus.WAITING_THREAD; } // pause f (state == ExecutonStatus.READY_PAUSE) { return processReadyPause(); } // stop f (state == ExecutonStatus.READY_STOP) { Lst<TaskInstance> stopLst = getCompleteTaskByState(ExecutonStatus.STOP); Lst<TaskInstance> kllLst = getCompleteTaskByState(ExecutonStatus.KILL); f (CollectonUtls.sNotEmpty(stopLst) || CollectonUtls.sNotEmpty(kllLst) || !sComplementEnd()) { return ExecutonStatus.STOP; } else { return ExecutonStatus.SUCCESS; } } // success f (state == ExecutonStatus.RUNNING_EXECUTION) { Lst<TaskInstance> kllTasks = getCompleteTaskByState(ExecutonStatus.KILL); f (readyToSubmtTaskQueue.sze() > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
//tasks cu return ExecutonStatus.RUNNING_EXECUTION; } else f (CollectonUtls.sNotEmpty(kllTasks)) { // tasks m return ExecutonStatus.FAILURE; } else { // f the return ExecutonStatus.SUCCESS; } } return state; } /** * whether complement end * * @return Boolean whether s complement end */ prvate boolean sComplementEnd() { f (!processInstance.sComplementData()) { return true; } try { Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); Date endTme = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); return processInstance.getScheduleTme().equals(endTme); } catch (Excepton e) { logger.error("complement end faled ", e); return false; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * updateProcessInstance process nstance state * after each batch of tasks s executed, the status of the process nstance s updated */ prvate vod updateProcessInstanceState() { ProcessInstance nstance = processServce.fndProcessInstanceById(processInstance.getId()); ExecutonStatus state = getProcessInstanceState(nstance); f (processInstance.getState() != state) { logger.nfo( "work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}", processInstance.getId(), processInstance.getName(), processInstance.getState(), state, processInstance.getCommandType()); nstance.setState(state); processServce.updateProcessInstance(nstance); processInstance = nstance; StateEvent stateEvent = new StateEvent(); stateEvent.setExecutonStatus(processInstance.getState()); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE); ths.processStateChangeHandler(stateEvent); } } /** * get task dependency result * * @param taskInstance task nstance * @return DependResult */ prvate DependResult getDependResultForTask(TaskInstance taskInstance) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return sTaskDepsComplete(Long.toStrng(taskInstance.getTaskCode())); } /** * add task to standby lst * * @param taskInstance task nstance */ prvate vod addTaskToStandByLst(TaskInstance taskInstance) { logger.nfo("add task to stand by lst: {}", taskInstance.getName()); try { readyToSubmtTaskQueue.put(taskInstance); } catch (Excepton e) { logger.error("add task nstance to readyToSubmtTaskQueue error, taskName: {}", taskInstance.getName(), e); } } /** * remove task from stand by lst * * @param taskInstance task nstance */ prvate vod removeTaskFromStandbyLst(TaskInstance taskInstance) { logger.nfo("remove task from stand by lst, d: {} name:{}", taskInstance.getId(), taskInstance.getName()); try { readyToSubmtTaskQueue.remove(taskInstance); } catch (Excepton e) { logger.error("remove task nstance from readyToSubmtTaskQueue error, task d:{}, Name: {}", taskInstance.getId(), taskInstance.getName(), e);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} } /** * has retry task n standby * * @return Boolean whether has retry task n standby */ prvate boolean hasRetryTaskInStandBy() { for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) { f (ter.next().getState().typeIsFalure()) { return true; } } return false; } /** * close the on gong tasks */ prvate vod kllAllTasks() { logger.nfo("kll called on process nstance d: {}, num: {}", processInstance.getId(), actveTaskProcessorMaps.sze()); for (nt taskId : actveTaskProcessorMaps.keySet()) { TaskInstance taskInstance = processServce.fndTaskInstanceById(taskId); f (taskInstance == null || taskInstance.getState().typeIsFnshed()) { contnue; } ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskId); taskProcessor.acton(TaskActon.STOP); f (taskProcessor.taskState().typeIsFnshed()) { StateEvent stateEvent = new StateEvent();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
stateEvent.setType(StateEventType.TASK_STATE_CHANGE); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setExecutonStatus(taskProcessor.taskState()); ths.addStateEvent(stateEvent); } } } publc boolean workFlowFnsh() { return ths.processInstance.getState().typeIsFnshed(); } /** * whether the retry nterval s tmed out * * @param taskInstance task nstance * @return Boolean */ prvate boolean retryTaskIntervalOverTme(TaskInstance taskInstance) { f (taskInstance.getState() != ExecutonStatus.FAILURE) { return true; } f (taskInstance.getId() == 0 || taskInstance.getMaxRetryTmes() == 0 || taskInstance.getRetryInterval() == 0) { return true; } Date now = new Date(); long faledTmeInterval = DateUtls.dfferSec(now, taskInstance.getEndTme());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
// task retry does not over tme, return false return taskInstance.getRetryInterval() * SEC_2_MINUTES_TIME_UNIT < faledTmeInterval; } /** * handlng the lst of tasks to be submtted */ prvate vod submtStandByTask() { try { nt length = readyToSubmtTaskQueue.sze(); for (nt = 0; < length; ++) { TaskInstance task = readyToSubmtTaskQueue.peek(); f (task == null) { contnue; } // stop ta f (task.taskCanRetry()) { TaskInstance retryTask = processServce.fndTaskInstanceById(task.getId()); f (retryTask != null && retryTask.getState().equals(ExecutonStatus.FORCED_SUCCESS)) { task.setState(retryTask.getState()); logger.nfo("task: {} has been forced success, put t nto complete task lst and stop retryng", task.getName()); removeTaskFromStandbyLst(task); completeTaskLst.put(Long.toStrng(task.getTaskCode()), task); submtPostNode(Long.toStrng(task.getTaskCode())); contnue; } } //nt var f (task.sFrstRun()) { //get pre Set<Strng> preTask = dag.getPrevousNodes(Long.toStrng(task.getTaskCode()));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
getPreVarPool(task, preTask); } DependResult dependResult = getDependResultForTask(task); f (DependResult.SUCCESS == dependResult) { f (retryTaskIntervalOverTme(task)) { TaskInstance taskInstance = submtTaskExec(task); f (taskInstance == null) { ths.taskFaledSubmt = true; } else { removeTaskFromStandbyLst(task); } } } else f (DependResult.FAILED == dependResult) { // f the dependFaledTask.put(Long.toStrng(task.getTaskCode()), task); removeTaskFromStandbyLst(task); logger.nfo("task {},d:{} depend result : {}", task.getName(), task.getId(), dependResult); } else f (DependResult.NON_EXEC == dependResult) { // for som removeTaskFromStandbyLst(task); logger.nfo("remove task {},d:{} , because depend result : {}", task.getName(), task.getId(), dependResult); } } } catch (Excepton e) { logger.error("submt standby task error", e); } } /** * get recovery task nstance *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @param taskId task d * @return recovery task nstance */ prvate TaskInstance getRecoveryTaskInstance(Strng taskId) { f (!StrngUtls.sNotEmpty(taskId)) { return null; } try { Integer ntId = Integer.valueOf(taskId); TaskInstance task = processServce.fndTaskInstanceById(ntId); f (task == null) { logger.error("start node d cannot be found: {}", taskId); } else { return task; } } catch (Excepton e) { logger.error("get recovery task nstance faled ", e); } return null; } /** * get start task nstance lst * * @param cmdParam command param * @return task nstance lst */ prvate Lst<TaskInstance> getStartTaskInstanceLst(Strng cmdParam) { Lst<TaskInstance> nstanceLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap != null && paramMap.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
Strng[] dLst = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).splt(Constants.COMMA); for (Strng nodeId : dLst) { TaskInstance task = getRecoveryTaskInstance(nodeId); f (task != null) { nstanceLst.add(task); } } } return nstanceLst; } /** * parse "StartNodeNameLst" from cmd param * * @param cmdParam command param * @return start node name lst */ prvate Lst<Strng> parseStartNodeName(Strng cmdParam) { Lst<Strng> startNodeNameLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap == null) { return startNodeNameLst; } f (paramMap.contansKey(CMD_PARAM_START_NODE_NAMES)) { startNodeNameLst = Arrays.asLst(paramMap.get(CMD_PARAM_START_NODE_NAMES).splt(Constants.COMMA)); } return startNodeNameLst; } /** * generate start node code lst from parsng command param; * f "StartNodeIdLst" exsts n command param, return StartNodeIdLst
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* * @return recovery node code lst */ prvate Lst<Strng> getRecoveryNodeCodeLst() { Lst<Strng> recoveryNodeCodeLst = new ArrayLst<>(); f (CollectonUtls.sNotEmpty(recoverNodeIdLst)) { for (TaskInstance task : recoverNodeIdLst) { recoveryNodeCodeLst.add(Long.toStrng(task.getTaskCode())); } } return recoveryNodeCodeLst; } /** * generate flow dag * * @param totalTaskNodeLst total task node lst * @param startNodeNameLst start node name lst * @param recoveryNodeCodeLst recovery node code lst * @param depNodeType depend node type * @return ProcessDag process dag * @throws Excepton excepton */ publc ProcessDag generateFlowDag(Lst<TaskNode> totalTaskNodeLst, Lst<Strng> startNodeNameLst, Lst<Strng> recoveryNodeCodeLst, TaskDependType depNodeType) throws Excepton { return DagHelper.generateFlowDag(totalTaskNodeLst, startNodeNameLst, recoveryNodeCodeLst, depNodeType); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/CommonTaskProcessor.java
/* * 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.server.master.runner.task; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.remote.command.TaskKillRequestCommand; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.dispatch.context.ExecutionContext; import org.apache.dolphinscheduler.server.master.dispatch.enums.ExecutorType; import org.apache.dolphinscheduler.server.master.dispatch.exceptions.ExecuteException; import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/CommonTaskProcessor.java
import org.apache.dolphinscheduler.service.queue.TaskPriority; import org.apache.dolphinscheduler.service.queue.TaskPriorityQueue; import org.apache.dolphinscheduler.service.queue.TaskPriorityQueueImpl; import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext; import org.apache.commons.lang.StringUtils; import java.util.Date; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; /** * common task processor */ public class CommonTaskProcessor extends BaseTaskProcessor { @Autowired private TaskPriorityQueue taskUpdateQueue; @Autowired MasterConfig masterConfig; @Autowired NettyExecutorManager nettyExecutorManager; /** * logger of MasterBaseTaskExecThread */ protected Logger logger = LoggerFactory.getLogger(getClass()); @Override public boolean submit(TaskInstance task, ProcessInstance processInstance, int maxRetryTimes, int commitInterval) { this.processInstance = processInstance; this.taskInstance = processService.submitTask(task, maxRetryTimes, commitInterval); if (this.taskInstance == null) { return false; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/CommonTaskProcessor.java
dispatchTask(taskInstance, processInstance); return true; } @Override public ExecutionStatus taskState() { return this.taskInstance.getState(); } @Override public void run() { } @Override protected boolean taskTimeout() { return true; } /** * common task cannot be paused */ @Override protected boolean pauseTask() { return true; } @Override public String getType() { return Constants.COMMON_TASK_TYPE; } private boolean dispatchTask(TaskInstance taskInstance, ProcessInstance processInstance) { try { if (taskUpdateQueue == null) { this.initQueue(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/CommonTaskProcessor.java
if (taskInstance.getState().typeIsFinished()) { logger.info(String.format("submit task , but task [%s] state [%s] is already finished. ", taskInstance.getName(), taskInstance.getState().toString())); return true; } if (taskInstance.getState() == ExecutionStatus.RUNNING_EXECUTION || taskInstance.getState() == ExecutionStatus.DELAY_EXECUTION) { logger.info("submit task, but the status of the task {} is already running or delayed.", taskInstance.getName()); return true; } logger.info("task ready to submit: {}", taskInstance); TaskPriority taskPriority = new TaskPriority(processInstance.getProcessInstancePriority().getCode(), processInstance.getId(), taskInstance.getProcessInstancePriority().getCode(), taskInstance.getId(), org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP); TaskExecutionContext taskExecutionContext = getTaskExecutionContext(taskInstance); taskPriority.setTaskExecutionContext(taskExecutionContext); taskUpdateQueue.put(taskPriority); logger.info(String.format("master submit success, task : %s", taskInstance.getName())); return true; } catch (Exception e) { logger.error("submit task Exception: ", e); logger.error("task error : {}", JSONUtils.toJsonString(taskInstance)); return false; } } public void initQueue() { this.taskUpdateQueue = SpringApplicationContext.getBean(TaskPriorityQueueImpl.class); } @Override public boolean killTask() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/CommonTaskProcessor.java
try { taskInstance = processService.findTaskInstanceById(taskInstance.getId()); if (taskInstance == null) { return true; } if (taskInstance.getState().typeIsFinished()) { return true; } if (StringUtils.isBlank(taskInstance.getHost())) { taskInstance.setState(ExecutionStatus.KILL); taskInstance.setEndTime(new Date()); processService.updateTaskInstance(taskInstance); return true; } TaskKillRequestCommand killCommand = new TaskKillRequestCommand(); killCommand.setTaskInstanceId(taskInstance.getId()); ExecutionContext executionContext = new ExecutionContext(killCommand.convert2Command(), ExecutorType.WORKER); Host host = Host.of(taskInstance.getHost()); executionContext.setHost(host); nettyExecutorManager.executeDirectly(executionContext); } catch (ExecuteException e) { logger.error("kill task error:", e); return false; } logger.info("master kill taskInstance name :{} taskInstance id:{}", taskInstance.getName(), taskInstance.getId()); return true; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
/* * 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.server.master.runner.task; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.TaskTimeoutStrategy; import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import java.util.Date; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * */ public class SubTaskProcessor extends BaseTaskProcessor {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
private ProcessInstance processInstance; private ProcessInstance subProcessInstance = null; private TaskDefinition taskDefinition; /** * run lock */ private final Lock runLock = new ReentrantLock(); @Override public boolean submit(TaskInstance task, ProcessInstance processInstance, int masterTaskCommitRetryTimes, int masterTaskCommitInterval) { this.processInstance = processInstance; taskDefinition = processService.findTaskDefinition( task.getTaskCode(), task.getTaskDefinitionVersion() ); this.taskInstance = processService.submitTask(task, masterTaskCommitRetryTimes, masterTaskCommitInterval); if (this.taskInstance == null) { return false; } return true; } @Override public ExecutionStatus taskState() { return this.taskInstance.getState(); } @Override public void run() { try { this.runLock.lock();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
if (setSubWorkFlow()) { updateTaskState(); } } catch (Exception e) { logger.error("work flow {} sub task {} exceptions", this.processInstance.getId(), this.taskInstance.getId(), e); } finally { this.runLock.unlock(); } } @Override protected boolean taskTimeout() { TaskTimeoutStrategy taskTimeoutStrategy = taskDefinition.getTimeoutNotifyStrategy(); if (TaskTimeoutStrategy.FAILED != taskTimeoutStrategy && TaskTimeoutStrategy.WARNFAILED != taskTimeoutStrategy) { return true; } logger.info("sub process task {} timeout, strategy {} ", taskInstance.getId(), taskTimeoutStrategy.getDescp()); killTask(); return true; } private void updateTaskState() { subProcessInstance = processService.findSubProcessInstance(processInstance.getId(), taskInstance.getId()); logger.info("work flow {} task {}, sub work flow: {} state: {}", this.processInstance.getId(), this.taskInstance.getId(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
subProcessInstance.getId(), subProcessInstance.getState().getDescp()); if (subProcessInstance != null && subProcessInstance.getState().typeIsFinished()) { taskInstance.setState(subProcessInstance.getState()); taskInstance.setEndTime(new Date()); processService.saveTaskInstance(taskInstance); } } @Override protected boolean pauseTask() { pauseSubWorkFlow(); return true; } private boolean pauseSubWorkFlow() { ProcessInstance subProcessInstance = processService.findSubProcessInstance(processInstance.getId(), taskInstance.getId()); if (subProcessInstance == null || taskInstance.getState().typeIsFinished()) { return false; } subProcessInstance.setState(ExecutionStatus.READY_PAUSE); processService.updateProcessInstance(subProcessInstance); return true; } private boolean setSubWorkFlow() { logger.info("set work flow {} task {} running", this.processInstance.getId(), this.taskInstance.getId()); if (this.subProcessInstance != null) { return true;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SubTaskProcessor.java
} subProcessInstance = processService.findSubProcessInstance(processInstance.getId(), taskInstance.getId()); if (subProcessInstance == null || taskInstance.getState().typeIsFinished()) { return false; } taskInstance.setState(ExecutionStatus.RUNNING_EXECUTION); taskInstance.setStartTime(new Date()); processService.updateTaskInstance(taskInstance); logger.info("set sub work flow {} task {} state: {}", processInstance.getId(), taskInstance.getId(), taskInstance.getState()); return true; } @Override protected boolean killTask() { ProcessInstance subProcessInstance = processService.findSubProcessInstance(processInstance.getId(), taskInstance.getId()); if (subProcessInstance == null || taskInstance.getState().typeIsFinished()) { return false; } subProcessInstance.setState(ExecutionStatus.READY_STOP); processService.updateProcessInstance(subProcessInstance); return true; } @Override public String getType() { return TaskType.SUB_PROCESS.getDesc(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/* * 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. */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
package org.apache.dolphinscheduler.service.process; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_EMPTY_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_FATHER_PARAMS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_ID; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; import static org.apache.dolphinscheduler.common.Constants.LOCAL_PARAMS; import static java.util.stream.Collectors.toSet; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TimeoutFlag; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.graph.DAG; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; import org.apache.dolphinscheduler.common.process.ProcessDag; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.process.ResourceInfo;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.TaskTimeoutParameter; import org.apache.dolphinscheduler.common.task.subprocess.SubProcessParameters; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils; import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils.SnowFlakeException; import org.apache.dolphinscheduler.common.utils.TaskParametersUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.DagData; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.Environment; import org.apache.dolphinscheduler.dao.entity.ErrorCommand; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog; import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.dao.entity.UdfFunc;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.CommandMapper; import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper; import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper; import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.TenantMapper; import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.dao.utils.DagHelper; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.EnumMap;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.facebook.presto.jdbc.internal.guava.collect.Lists; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; /** * process relative dao that some mappers in this. */ @Component public class ProcessService { private final Logger logger = LoggerFactory.getLogger(getClass()); private final int[] stateArray = new int[]{ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal()}; @Autowired private UserMapper userMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@Autowired private ProcessDefinitionMapper processDefineMapper; @Autowired private ProcessDefinitionLogMapper processDefineLogMapper; @Autowired private ProcessInstanceMapper processInstanceMapper; @Autowired private DataSourceMapper dataSourceMapper; @Autowired private ProcessInstanceMapMapper processInstanceMapMapper; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private CommandMapper commandMapper; @Autowired private ScheduleMapper scheduleMapper; @Autowired private UdfFuncMapper udfFuncMapper; @Autowired private ResourceMapper resourceMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ErrorCommandMapper errorCommandMapper; @Autowired private TenantMapper tenantMapper; @Autowired private ProjectMapper projectMapper; @Autowired private TaskDefinitionMapper taskDefinitionMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private ProcessTaskRelationLogMapper processTaskRelationLogMapper; @Autowired private EnvironmentMapper environmentMapper; /** * handle Command (construct ProcessInstance from Command) , wrapped in transaction * * @param logger logger * @param host host * @param validThreadNum validThreadNum * @param command found command * @return process instance */ @Transactional(rollbackFor = Exception.class) public ProcessInstance handleCommand(Logger logger, String host, int validThreadNum, Command command) { ProcessInstance processInstance = constructProcessInstance(command, host); if (processInstance == null) { logger.error("scan command, command parameter is error: {}", command); moveToErrorCommand(command, "process instance is null"); return null; } if (!checkThreadNum(command, validThreadNum)) { logger.info("there is not enough thread for this command: {}", command); return setWaitingThreadProcess(command, processInstance); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstance.setCommandType(command.getCommandType()); processInstance.addHistoryCmd(command.getCommandType()); saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); this.commandMapper.deleteById(command.getId()); return processInstance; } /** * save error command, and delete original command * * @param command command * @param message message */ @Transactional(rollbackFor = Exception.class) public void moveToErrorCommand(Command command, String message) { ErrorCommand errorCommand = new ErrorCommand(command, message); this.errorCommandMapper.insert(errorCommand); this.commandMapper.deleteById(command.getId()); } /** * set process waiting thread * * @param command command * @param processInstance processInstance * @return process instance */ private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { processInstance.setState(ExecutionStatus.WAITING_THREAD); if (command.getCommandType() != CommandType.RECOVER_WAITING_THREAD) { processInstance.addHistoryCmd(command.getCommandType());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); createRecoveryWaitingThreadCommand(command, processInstance); return null; } /** * check thread num * * @param command command * @param validThreadNum validThreadNum * @return if thread is enough */ private boolean checkThreadNum(Command command, int validThreadNum) { int commandThreadCount = this.workProcessThreadNumCount(command.getProcessDefinitionCode()); return validThreadNum >= commandThreadCount; } /** * insert one command * * @param command command * @return create result */ public int createCommand(Command command) { int result = 0; if (command != null) { result = commandMapper.insert(command); } return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,455
[Bug] [Master] Cannot stop sub process task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened cannot stop the sub process tasks. ### What you expected to happen stop the tasks normally ### How to reproduce start a process. kill the process ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6455
https://github.com/apache/dolphinscheduler/pull/6458
4d69685ba1f9ecc8595dffc13194ec902531ed51
a8baa9553fd64d1414c204c6ba95019b7376f771
"2021-10-08T02:35:44Z"
java
"2021-10-08T06:08:12Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/** * find one command from queue list * * @return command */ public Command findOneCommand() { return commandMapper.getOneToRun(); } /** * get command page * * @param pageSize * @param pageNumber * @return */ public List<Command> findCommandPage(int pageSize, int pageNumber) { return commandMapper.queryCommandPage(pageSize, pageNumber * pageSize); } /** * check the input command exists in queue list * * @param command command * @return create command result */ public boolean verifyIsNeedCreateCommand(Command command) { boolean isNeedCreate = true; EnumMap<CommandType, Integer> cmdTypeMap = new EnumMap<>(CommandType.class); cmdTypeMap.put(CommandType.REPEAT_RUNNING, 1); cmdTypeMap.put(CommandType.RECOVER_SUSPENDED_PROCESS, 1); cmdTypeMap.put(CommandType.START_FAILURE_TASK_PROCESS, 1);