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
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,997 |
[Bug] [API] The workflow instance clicks the rerun button, and the end time is the end time of the last instance
|
### 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
The workflow instance clicks the rerun button, and the end time is the end time of the last instance.
<img width="1181" alt="iShot_2022-11-25_17 00 46" src="https://user-images.githubusercontent.com/37063904/203942380-f4f70834-5540-4302-bbee-1f6e828207fd.png">
### What you expected to happen
When the workflow instance clicks the rerun button, the end time is reset to null.
### How to reproduce
The workflow instance clicks the rerun button and observes the end time of the instance.
### Anything else
_No response_
### Version
3.1.x
### 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/12997
|
https://github.com/apache/dolphinscheduler/pull/12998
|
d480c271ec7d86b3af1a6132b88bbb2cdcabc558
|
f9a0ecbc81a5a63b4265983e41b05281db14b772
| 2022-11-25T09:06:34Z |
java
| 2022-11-27T07:08:30Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java
|
/**
* add command to history
*
* @param cmd cmd
*/
public void addHistoryCmd(CommandType cmd) {
if (!Strings.isNullOrEmpty(this.historyCmd)) {
this.historyCmd = String.format("%s,%s", this.historyCmd, cmd.toString());
} else {
this.historyCmd = cmd.toString();
}
}
/**
* check this process is start complement data
*
* @return whether complement data
*/
public boolean isComplementData() {
if (Strings.isNullOrEmpty(this.historyCmd)) {
return false;
}
return historyCmd.startsWith(CommandType.COMPLEMENT_DATA.toString());
}
/**
* get current command type,
* if start with complement data,return complement
*
* @return CommandType
*/
public CommandType getCmdTypeIfComplement() {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,997 |
[Bug] [API] The workflow instance clicks the rerun button, and the end time is the end time of the last instance
|
### 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
The workflow instance clicks the rerun button, and the end time is the end time of the last instance.
<img width="1181" alt="iShot_2022-11-25_17 00 46" src="https://user-images.githubusercontent.com/37063904/203942380-f4f70834-5540-4302-bbee-1f6e828207fd.png">
### What you expected to happen
When the workflow instance clicks the rerun button, the end time is reset to null.
### How to reproduce
The workflow instance clicks the rerun button and observes the end time of the instance.
### Anything else
_No response_
### Version
3.1.x
### 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/12997
|
https://github.com/apache/dolphinscheduler/pull/12998
|
d480c271ec7d86b3af1a6132b88bbb2cdcabc558
|
f9a0ecbc81a5a63b4265983e41b05281db14b772
| 2022-11-25T09:06:34Z |
java
| 2022-11-27T07:08:30Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessInstance.java
|
if (isComplementData()) {
return CommandType.COMPLEMENT_DATA;
}
return commandType;
}
/**
* set state with desc
* @param state
* @param stateDesc
*/
public void setStateWithDesc(WorkflowExecutionStatus state, String stateDesc) {
this.setState(state);
if (StringUtils.isEmpty(this.getStateHistory())) {
stateDescList = new ArrayList<>();
} else if (stateDescList == null) {
stateDescList = JSONUtils.toList(this.getStateHistory(), StateDesc.class);
}
stateDescList.add(new StateDesc(new Date(), state, stateDesc));
this.setStateHistory(JSONUtils.toJsonString(stateDescList));
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class StateDesc {
Date time;
WorkflowExecutionStatus state;
String desc;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.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.plugin.task.flink;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class FlinkArgsUtilsTest {
private String joinStringListWithSpace(List<String> stringList) {
return String.join(" ", stringList);
}
private FlinkStreamParameters buildTestFlinkParametersWithDeployMode(FlinkDeployMode flinkDeployMode) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
FlinkStreamParameters flinkParameters = new FlinkStreamParameters();
flinkParameters.setProgramType(ProgramType.SCALA);
flinkParameters.setDeployMode(flinkDeployMode);
flinkParameters.setParallelism(4);
ResourceInfo resourceInfo = new ResourceInfo();
resourceInfo.setId(1);
resourceInfo.setResourceName("job");
resourceInfo.setRes("/opt/job.jar");
flinkParameters.setMainJar(resourceInfo);
flinkParameters.setMainClass("org.example.Main");
flinkParameters.setSlot(4);
flinkParameters.setAppName("demo-app-name");
flinkParameters.setJobManagerMemory("1024m");
flinkParameters.setTaskManagerMemory("1024m");
return flinkParameters;
}
private TaskExecutionContext buildTestTaskExecutionContext() {
TaskExecutionContext taskExecutionContext = new TaskExecutionContext();
taskExecutionContext.setTaskAppId("app-id");
taskExecutionContext.setExecutePath("/tmp/execution");
return taskExecutionContext;
}
@Test
public void testRunJarInApplicationMode() throws Exception {
FlinkStreamParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.APPLICATION);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run-application -t yarn-application -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
@Test
public void testRunJarInClusterMode() throws Exception {
FlinkStreamParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER);
flinkParameters.setFlinkVersion("1.11");
List<String> commandLine1 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -m yarn-cluster -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine1));
flinkParameters.setFlinkVersion("<1.10");
List<String> commandLine2 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -m yarn-cluster -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine2));
flinkParameters.setFlinkVersion(">=1.12");
List<String> commandLine3 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -t yarn-per-job -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine3));
}
@Test
public void testRunJarInLocalMode() throws Exception {
FlinkStreamParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.LOCAL);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
@Test
public void testRunSql() throws Exception {
FlinkStreamParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER);
flinkParameters.setProgramType(ProgramType.SQL);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals("sql-client.sh -i /tmp/execution/app-id_init.sql -f /tmp/execution/app-id_node.sql",
joinStringListWithSpace(commandLine));
}
@Test
public void testInitOptionsInClusterMode() throws Exception {
List<String> initOptions =
FlinkArgsUtils.buildInitOptionsForSql(buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER));
Assertions.assertEquals(2, initOptions.size());
Assertions.assertTrue(initOptions.contains("set execution.target=local"));
Assertions.assertTrue(initOptions.contains("set parallelism.default=4"));
}
@Test
public void testInitOptionsInApplicationMode() throws Exception {
List<String> initOptions = FlinkArgsUtils
.buildInitOptionsForSql(buildTestFlinkParametersWithDeployMode(FlinkDeployMode.APPLICATION));
Assertions.assertEquals(6, initOptions.size());
Assertions.assertTrue(initOptions.contains("set execution.target=yarn-per-job"));
Assertions.assertTrue(initOptions.contains("set taskmanager.numberOfTaskSlots=4"));
Assertions.assertTrue(initOptions.contains("set yarn.application.name=demo-app-name"));
Assertions.assertTrue(initOptions.contains("set jobmanager.memory.process.size=1024m"));
Assertions.assertTrue(initOptions.contains("set taskmanager.memory.process.size=1024m"));
Assertions.assertTrue(initOptions.contains("set parallelism.default=4"));
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.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.plugin.task.flink;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
import org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils;
import org.apache.dolphinscheduler.plugin.task.api.parser.ParameterUtils;
import org.apache.dolphinscheduler.plugin.task.api.utils.ArgsUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* flink args utils
*/
public class FlinkArgsUtils {
private FlinkArgsUtils() {
throw new IllegalStateException("Utility class");
}
private static final String LOCAL_DEPLOY_MODE = "local";
private static final String FLINK_VERSION_BEFORE_1_10 = "<1.10";
private static final String FLINK_VERSION_AFTER_OR_EQUALS_1_12 = ">=1.12";
private static final String FLINK_VERSION_AFTER_OR_EQUALS_1_13 = ">=1.13";
/**
* default flink deploy mode
*/
public static final FlinkDeployMode DEFAULT_DEPLOY_MODE = FlinkDeployMode.CLUSTER;
/**
* build flink run command line
*
* @param param flink parameters
* @return argument list
*/
public static List<String> buildRunCommandLine(TaskExecutionContext taskExecutionContext, FlinkParameters param) {
switch (param.getProgramType()) {
case SQL:
return buildRunCommandLineForSql(taskExecutionContext, param);
default:
return buildRunCommandLineForOthers(taskExecutionContext, param);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
}
}
/**
* build flink cancel command line
* @param taskExecutionContext
* @return
*/
public static List<String> buildCancelCommandLine(TaskExecutionContext taskExecutionContext) {
List<String> args = new ArrayList<>();
args.add(FlinkConstants.FLINK_COMMAND);
args.add(FlinkConstants.FLINK_CANCEL);
args.add(taskExecutionContext.getAppIds());
return args;
}
/**
* build flink savepoint command line, the savepoint folder should be set in flink conf
* @return
*/
public static List<String> buildSavePointCommandLine(TaskExecutionContext taskExecutionContext) {
List<String> args = new ArrayList<>();
args.add(FlinkConstants.FLINK_COMMAND);
args.add(FlinkConstants.FLINK_SAVEPOINT);
args.add(taskExecutionContext.getAppIds());
return args;
}
/**
* build flink run command line for SQL
*
* @return argument list
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
private static List<String> buildRunCommandLineForSql(TaskExecutionContext taskExecutionContext,
FlinkParameters flinkParameters) {
List<String> args = new ArrayList<>();
args.add(FlinkConstants.FLINK_SQL_COMMAND);
String initScriptFilePath = FileUtils.getInitScriptFilePath(taskExecutionContext);
args.add(FlinkConstants.FLINK_SQL_INIT_FILE);
args.add(initScriptFilePath);
String scriptFilePath = FileUtils.getScriptFilePath(taskExecutionContext);
args.add(FlinkConstants.FLINK_SQL_SCRIPT_FILE);
args.add(scriptFilePath);
String others = flinkParameters.getOthers();
if (StringUtils.isNotEmpty(others)) {
args.add(others);
}
return args;
}
public static List<String> buildInitOptionsForSql(FlinkParameters flinkParameters) {
List<String> initOptions = new ArrayList<>();
FlinkDeployMode deployMode =
Optional.ofNullable(flinkParameters.getDeployMode()).orElse(FlinkDeployMode.CLUSTER);
/**
* Currently flink sql on yarn only supports yarn-per-job mode
*/
if (FlinkDeployMode.CLUSTER == deployMode) {
initOptions.add(String.format(FlinkConstants.FLINK_FORMAT_EXECUTION_TARGET, "local"));
} else {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
initOptions.add(
String.format(FlinkConstants.FLINK_FORMAT_EXECUTION_TARGET, FlinkConstants.FLINK_YARN_PER_JOB));
int slot = flinkParameters.getSlot();
if (slot > 0) {
initOptions.add(String.format(FlinkConstants.FLINK_FORMAT_TASKMANAGER_NUMBEROFTASKSLOTS, slot));
}
String appName = flinkParameters.getAppName();
if (StringUtils.isNotEmpty(appName)) {
initOptions.add(
String.format(FlinkConstants.FLINK_FORMAT_YARN_APPLICATION_NAME, ArgsUtils.escape(appName)));
}
String jobManagerMemory = flinkParameters.getJobManagerMemory();
if (StringUtils.isNotEmpty(jobManagerMemory)) {
initOptions.add(
String.format(FlinkConstants.FLINK_FORMAT_JOBMANAGER_MEMORY_PROCESS_SIZE, jobManagerMemory));
}
String taskManagerMemory = flinkParameters.getTaskManagerMemory();
if (StringUtils.isNotEmpty(taskManagerMemory)) {
initOptions.add(
String.format(FlinkConstants.FLINK_FORMAT_TASKMANAGER_MEMORY_PROCESS_SIZE, taskManagerMemory));
}
String others = flinkParameters.getOthers();
if (StringUtils.isEmpty(others) || !others.contains(FlinkConstants.FLINK_QUEUE)) {
String queue = flinkParameters.getQueue();
if (StringUtils.isNotEmpty(queue)) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
initOptions.add(String.format(FlinkConstants.FLINK_FORMAT_YARN_APPLICATION_QUEUE, queue));
}
}
}
int parallelism = flinkParameters.getParallelism();
if (parallelism > 0) {
initOptions.add(String.format(FlinkConstants.FLINK_FORMAT_PARALLELISM_DEFAULT, parallelism));
}
return initOptions;
}
private static List<String> buildRunCommandLineForOthers(TaskExecutionContext taskExecutionContext,
FlinkParameters flinkParameters) {
List<String> args = new ArrayList<>();
args.add(FlinkConstants.FLINK_COMMAND);
FlinkDeployMode deployMode = Optional.ofNullable(flinkParameters.getDeployMode()).orElse(DEFAULT_DEPLOY_MODE);
String flinkVersion = flinkParameters.getFlinkVersion();
switch (deployMode) {
case CLUSTER:
if (FLINK_VERSION_AFTER_OR_EQUALS_1_12.equals(flinkVersion)
|| FLINK_VERSION_AFTER_OR_EQUALS_1_13.equals(flinkVersion)) {
args.add(FlinkConstants.FLINK_RUN);
args.add(FlinkConstants.FLINK_EXECUTION_TARGET);
args.add(FlinkConstants.FLINK_YARN_PER_JOB);
} else {
args.add(FlinkConstants.FLINK_RUN);
args.add(FlinkConstants.FLINK_RUN_MODE);
args.add(FlinkConstants.FLINK_YARN_CLUSTER);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
break;
case APPLICATION:
args.add(FlinkConstants.FLINK_RUN_APPLICATION);
args.add(FlinkConstants.FLINK_EXECUTION_TARGET);
args.add(FlinkConstants.FLINK_YARN_APPLICATION);
break;
case LOCAL:
args.add(FlinkConstants.FLINK_RUN);
break;
}
String others = flinkParameters.getOthers();
switch (deployMode) {
case CLUSTER:
case APPLICATION:
int slot = flinkParameters.getSlot();
if (slot > 0) {
args.add(FlinkConstants.FLINK_YARN_SLOT);
args.add(String.format("%d", slot));
}
String appName = flinkParameters.getAppName();
if (StringUtils.isNotEmpty(appName)) {
args.add(FlinkConstants.FLINK_APP_NAME);
args.add(ArgsUtils.escape(appName));
}
if (flinkVersion == null || FLINK_VERSION_BEFORE_1_10.equals(flinkVersion)) {
int taskManager = flinkParameters.getTaskManager();
if (taskManager > 0) {
args.add(FlinkConstants.FLINK_TASK_MANAGE);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
args.add(String.format("%d", taskManager));
}
}
String jobManagerMemory = flinkParameters.getJobManagerMemory();
if (StringUtils.isNotEmpty(jobManagerMemory)) {
args.add(FlinkConstants.FLINK_JOB_MANAGE_MEM);
args.add(jobManagerMemory);
}
String taskManagerMemory = flinkParameters.getTaskManagerMemory();
if (StringUtils.isNotEmpty(taskManagerMemory)) {
args.add(FlinkConstants.FLINK_TASK_MANAGE_MEM);
args.add(taskManagerMemory);
}
if (StringUtils.isEmpty(others) || !others.contains(FlinkConstants.FLINK_QUEUE)) {
String queue = flinkParameters.getQueue();
if (StringUtils.isNotEmpty(queue)) {
args.add(FlinkConstants.FLINK_QUEUE);
args.add(queue);
}
}
break;
case LOCAL:
break;
}
int parallelism = flinkParameters.getParallelism();
if (parallelism > 0) {
args.add(FlinkConstants.FLINK_PARALLELISM);
args.add(String.format("%d", parallelism));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java
|
args.add(FlinkConstants.FLINK_SHUTDOWN_ON_ATTACHED_EXIT);
if (StringUtils.isNotEmpty(others)) {
args.add(others);
}
ProgramType programType = flinkParameters.getProgramType();
String mainClass = flinkParameters.getMainClass();
if (programType != null && programType != ProgramType.PYTHON && StringUtils.isNotEmpty(mainClass)) {
args.add(FlinkConstants.FLINK_MAIN_CLASS);
args.add(flinkParameters.getMainClass());
}
ResourceInfo mainJar = flinkParameters.getMainJar();
if (mainJar != null) {
if (ProgramType.PYTHON == programType) {
args.add(FlinkConstants.FLINK_PYTHON);
}
args.add(mainJar.getRes());
}
String mainArgs = flinkParameters.getMainArgs();
if (StringUtils.isNotEmpty(mainArgs)) {
Map<String, Property> paramsMap = taskExecutionContext.getPrepareParamsMap();
args.add(ParameterUtils.convertParameterPlaceholders(mainArgs, ParamUtils.convert(paramsMap)));
}
return args;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkConstants.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.plugin.task.flink;
public class FlinkConstants {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkConstants.java
|
private FlinkConstants() {
throw new IllegalStateException("Utility class");
}
/**
* flink command
* usage: flink run [OPTIONS] <jar-file> <arguments>
*/
public static final String FLINK_COMMAND = "flink";
public static final String FLINK_RUN = "run";
/**
* flink sql command
* usage: sql-client.sh -i <initialization file>, -f <script file>
*/
public static final String FLINK_SQL_COMMAND = "sql-client.sh";
/**
* flink run options
*/
public static final String FLINK_RUN_APPLICATION = "run-application";
public static final String FLINK_YARN_CLUSTER = "yarn-cluster";
public static final String FLINK_YARN_APPLICATION = "yarn-application";
public static final String FLINK_YARN_PER_JOB = "yarn-per-job";
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkConstants.java
|
public static final String FLINK_RUN_MODE = "-m";
public static final String FLINK_EXECUTION_TARGET = "-t";
public static final String FLINK_YARN_SLOT = "-ys";
public static final String FLINK_APP_NAME = "-ynm";
public static final String FLINK_QUEUE = "-yqu";
public static final String FLINK_TASK_MANAGE = "-yn";
public static final String FLINK_JOB_MANAGE_MEM = "-yjm";
public static final String FLINK_TASK_MANAGE_MEM = "-ytm";
public static final String FLINK_MAIN_CLASS = "-c";
public static final String FLINK_PARALLELISM = "-p";
public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae";
public static final String FLINK_PYTHON = "-py";
public static final String FLINK_SAVEPOINT = "savepoint";
public static final String FLINK_METRICS = "metrics";
public static final String FLINK_OVERVIEW = "overview";
public static final String FLINK_JOBS = "jobs";
public static final String FLINK_CANCEL = "cancel";
public static final String FLINK_FORMAT_EXECUTION_TARGET = "set execution.target=%s";
public static final String FLINK_FORMAT_YARN_APPLICATION_NAME = "set yarn.application.name=%s";
public static final String FLINK_FORMAT_YARN_APPLICATION_QUEUE = "set yarn.application.queue=%s";
public static final String FLINK_FORMAT_JOBMANAGER_MEMORY_PROCESS_SIZE = "set jobmanager.memory.process.size=%s";
public static final String FLINK_FORMAT_TASKMANAGER_MEMORY_PROCESS_SIZE = "set taskmanager.memory.process.size=%s";
public static final String FLINK_FORMAT_TASKMANAGER_NUMBEROFTASKSLOTS = "set taskmanager.numberOfTaskSlots=%d";
public static final String FLINK_FORMAT_PARALLELISM_DEFAULT = "set parallelism.default=%d";
public static final String FLINK_SQL_SCRIPT_FILE = "-f";
public static final String FLINK_SQL_INIT_FILE = "-i";
public static final String FLINK_SQL_NEWLINE = ";\n";
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.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.plugin.task.flink;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class FlinkArgsUtilsTest {
private String joinStringListWithSpace(List<String> stringList) {
return String.join(" ", stringList);
}
private FlinkParameters buildTestFlinkParametersWithDeployMode(FlinkDeployMode flinkDeployMode) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
FlinkParameters flinkParameters = new FlinkParameters();
flinkParameters.setProgramType(ProgramType.SCALA);
flinkParameters.setDeployMode(flinkDeployMode);
flinkParameters.setParallelism(4);
ResourceInfo resourceInfo = new ResourceInfo();
resourceInfo.setId(1);
resourceInfo.setResourceName("job");
resourceInfo.setRes("/opt/job.jar");
flinkParameters.setMainJar(resourceInfo);
flinkParameters.setMainClass("org.example.Main");
flinkParameters.setSlot(4);
flinkParameters.setAppName("demo-app-name");
flinkParameters.setJobManagerMemory("1024m");
flinkParameters.setTaskManagerMemory("1024m");
return flinkParameters;
}
private TaskExecutionContext buildTestTaskExecutionContext() {
TaskExecutionContext taskExecutionContext = new TaskExecutionContext();
taskExecutionContext.setTaskAppId("app-id");
taskExecutionContext.setExecutePath("/tmp/execution");
return taskExecutionContext;
}
@Test
public void testRunJarInApplicationMode() throws Exception {
FlinkParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.APPLICATION);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run-application -t yarn-application -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
@Test
public void testRunJarInClusterMode() throws Exception {
FlinkParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER);
flinkParameters.setFlinkVersion("1.11");
List<String> commandLine1 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -m yarn-cluster -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine1));
flinkParameters.setFlinkVersion("<1.10");
List<String> commandLine2 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -m yarn-cluster -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine2));
flinkParameters.setFlinkVersion(">=1.12");
List<String> commandLine3 =
FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -t yarn-per-job -ys 4 -ynm demo-app-name -yjm 1024m -ytm 1024m -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine3));
}
@Test
public void testRunJarInLocalMode() throws Exception {
FlinkParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.LOCAL);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals(
"flink run -p 4 -sae -c org.example.Main /opt/job.jar",
joinStringListWithSpace(commandLine));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,010 |
[Bug] [Task] The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode
|
### 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
The Flink SQL task page selects the pre-job deployment mode, but the task executed by the worker is the Flink local mode.
### What you expected to happen
The Flink SQL task page selects the pre-job deployment mode, and the task executed by the worker is the Flink per-job mode
### How to reproduce
Select the Flink task type, use SQL, select per-job as the deployment mode, execute this task, and view the flink tasks started by the worker.
### Anything else
_No response_
### Version
3.1.x
### 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/13010
|
https://github.com/apache/dolphinscheduler/pull/13011
|
1a8811cb419551045d0d05b99116e2d2560d6a6f
|
ae670e6e1c0c0bcd645ab3e1776eca75b9765b8c
| 2022-11-26T14:38:22Z |
java
| 2022-11-28T02:09:49Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/test/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtilsTest.java
|
@Test
public void testRunSql() throws Exception {
FlinkParameters flinkParameters = buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER);
flinkParameters.setProgramType(ProgramType.SQL);
List<String> commandLine = FlinkArgsUtils.buildRunCommandLine(buildTestTaskExecutionContext(), flinkParameters);
Assertions.assertEquals("sql-client.sh -i /tmp/execution/app-id_init.sql -f /tmp/execution/app-id_node.sql",
joinStringListWithSpace(commandLine));
}
@Test
public void testInitOptionsInClusterMode() throws Exception {
List<String> initOptions =
FlinkArgsUtils.buildInitOptionsForSql(buildTestFlinkParametersWithDeployMode(FlinkDeployMode.CLUSTER));
Assertions.assertEquals(2, initOptions.size());
Assertions.assertTrue(initOptions.contains("set execution.target=local"));
Assertions.assertTrue(initOptions.contains("set parallelism.default=4"));
}
@Test
public void testInitOptionsInApplicationMode() throws Exception {
List<String> initOptions = FlinkArgsUtils
.buildInitOptionsForSql(buildTestFlinkParametersWithDeployMode(FlinkDeployMode.APPLICATION));
Assertions.assertEquals(6, initOptions.size());
Assertions.assertTrue(initOptions.contains("set execution.target=yarn-per-job"));
Assertions.assertTrue(initOptions.contains("set taskmanager.numberOfTaskSlots=4"));
Assertions.assertTrue(initOptions.contains("set yarn.application.name=demo-app-name"));
Assertions.assertTrue(initOptions.contains("set jobmanager.memory.process.size=1024m"));
Assertions.assertTrue(initOptions.contains("set taskmanager.memory.process.size=1024m"));
Assertions.assertTrue(initOptions.contains("set parallelism.default=4"));
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.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.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.*;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.ProcessInstanceService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* process instance controller
*/
@Tag(name = "PROCESS_INSTANCE_TAG")
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@RestController
@RequestMapping("/projects/{projectCode}/process-instances")
public class ProcessInstanceController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(ProcessInstanceController.class);
@Autowired
private ProcessInstanceService processInstanceService;
/**
* query process instance list paging
*
* @param loginUser login user
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
* @param projectCode project code
* @param pageNo page number
* @param pageSize page size
* @param processDefineCode process definition code
* @param searchVal search value
* @param stateType state type
* @param host host
* @param startTime start time
* @param endTime end time
* @param otherParamsJson otherParamsJson handle other params
* @return process instance list
*/
@Operation(summary = "queryProcessInstanceListPaging", description = "QUERY_PROCESS_INSTANCE_LIST_NOTES")
@Parameters({
@Parameter(name = "processDefineCode", description = "PROCESS_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "100")),
@Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)),
@Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)),
@Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = WorkflowExecutionStatus.class)),
@Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)),
@Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)),
@Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)),
@Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")),
@Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10"))
})
@GetMapping()
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryProcessInstanceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@RequestParam(value = "processDefineCode", required = false, defaultValue = "0") long processDefineCode,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam(value = "executorName", required = false) String executorName,
@RequestParam(value = "stateType", required = false) WorkflowExecutionStatus stateType,
@RequestParam(value = "host", required = false) String host,
@RequestParam(value = "startDate", required = false) String startTime,
@RequestParam(value = "endDate", required = false) String endTime,
@RequestParam(value = "otherParamsJson", required = false) String otherParamsJson,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
searchVal = ParameterUtils.handleEscapes(searchVal);
result = processInstanceService.queryProcessInstanceList(loginUser, projectCode, processDefineCode, startTime,
endTime,
searchVal, executorName, stateType, host, otherParamsJson, pageNo, pageSize);
return result;
}
/**
* query task list by process instance id
*
* @param loginUser login user
* @param projectCode project code
* @param id process instance id
* @return task list for the process instance
*/
@Operation(summary = "queryTaskListByProcessId", description = "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES")
@Parameters({
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@GetMapping(value = "/{id}/tasks")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryTaskListByProcessId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable("id") Integer id) throws IOException {
Map<String, Object> result = processInstanceService.queryTaskListByProcessId(loginUser, projectCode, id);
return returnDataList(result);
}
/**
* update process instance
*
* @param loginUser login user
* @param projectCode project code
* @param taskRelationJson process task relation json
* @param taskDefinitionJson taskDefinitionJson
* @param id process instance id
* @param scheduleTime schedule time
* @param syncDefine sync define
* @param locations locations
* @param tenantCode tenantCode
* @return update result code
*/
@Operation(summary = "updateProcessInstance", description = "UPDATE_PROCESS_INSTANCE_NOTES")
@Parameters({
@Parameter(name = "taskRelationJson", description = "TASK_RELATION_JSON", schema = @Schema(implementation = String.class)),
@Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", schema = @Schema(implementation = String.class)),
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")),
@Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", schema = @Schema(implementation = String.class)),
@Parameter(name = "syncDefine", description = "SYNC_DEFINE", required = true, schema = @Schema(implementation = boolean.class, example = "false")),
@Parameter(name = "globalParams", description = "PROCESS_GLOBAL_PARAMS", schema = @Schema(implementation = String.class, example = "[]")),
@Parameter(name = "locations", description = "PROCESS_INSTANCE_LOCATIONS", schema = @Schema(implementation = String.class)),
@Parameter(name = "timeout", description = "PROCESS_TIMEOUT", schema = @Schema(implementation = int.class, example = "0")),
@Parameter(name = "tenantCode", description = "TENANT_CODE", schema = @Schema(implementation = String.class, example = "default"))
})
@PutMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(UPDATE_PROCESS_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam(value = "taskRelationJson", required = true) String taskRelationJson,
@RequestParam(value = "taskDefinitionJson", required = true) String taskDefinitionJson,
@PathVariable(value = "id") Integer id,
@RequestParam(value = "scheduleTime", required = false) String scheduleTime,
@RequestParam(value = "syncDefine", required = true) Boolean syncDefine,
@RequestParam(value = "globalParams", required = false, defaultValue = "[]") String globalParams,
@RequestParam(value = "locations", required = false) String locations,
@RequestParam(value = "timeout", required = false, defaultValue = "0") int timeout,
@RequestParam(value = "tenantCode", required = true) String tenantCode) {
Map<String, Object> result = processInstanceService.updateProcessInstance(loginUser, projectCode, id,
taskRelationJson, taskDefinitionJson, scheduleTime, syncDefine, globalParams, locations, timeout,
tenantCode);
return returnDataList(result);
}
/**
* query process instance by id
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
*
* @param loginUser login user
* @param projectCode project code
* @param id process instance id
* @return process instance detail
*/
@Operation(summary = "queryProcessInstanceById", description = "QUERY_PROCESS_INSTANCE_BY_ID_NOTES")
@Parameters({
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@GetMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_BY_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable("id") Integer id) {
Map<String, Object> result = processInstanceService.queryProcessInstanceById(loginUser, projectCode, id);
return returnDataList(result);
}
/**
* query top n process instance order by running duration
*
* @param loginUser login user
* @param projectCode project code
* @param size number of process instance
* @param startTime start time
* @param endTime end time
* @return list of process instance
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@Operation(summary = "queryTopNLongestRunningProcessInstance", description = "QUERY_TOPN_LONGEST_RUNNING_PROCESS_INSTANCE_NOTES")
@Parameters({
@Parameter(name = "size", description = "PROCESS_INSTANCE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")),
@Parameter(name = "startTime", description = "PROCESS_INSTANCE_START_TIME", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "endTime", description = "PROCESS_INSTANCE_END_TIME", required = true, schema = @Schema(implementation = String.class)),
})
@GetMapping(value = "/top-n")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_BY_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result<ProcessInstance> queryTopNLongestRunningProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam("size") Integer size,
@RequestParam(value = "startTime", required = true) String startTime,
@RequestParam(value = "endTime", required = true) String endTime) {
Map<String, Object> result = processInstanceService.queryTopNLongestRunningProcessInstance(loginUser,
projectCode, size, startTime, endTime);
return returnDataList(result);
}
/**
* delete process instance by id, at the same time,
* delete task instance and their mapping relation data
*
* @param loginUser login user
* @param projectCode project code
* @param id process instance id
* @return delete result code
*/
@Operation(summary = "deleteProcessInstanceById", description = "DELETE_PROCESS_INSTANCE_BY_ID_NOTES")
@Parameters({
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_PROCESS_INSTANCE_BY_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result<ProcessInstance> deleteProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable("id") Integer id) {
Map<String, Object> result = processInstanceService.deleteProcessInstanceById(loginUser, projectCode, id);
return returnDataList(result);
}
/**
* query sub process instance detail info by task id
*
* @param loginUser login user
* @param projectCode project code
* @param taskId task id
* @return sub process instance detail
*/
@Operation(summary = "querySubProcessInstanceByTaskCode", description = "QUERY_SUBPROCESS_INSTANCE_BY_TASK_CODE_NOTES")
@Parameters({
@Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class, example = "100"))
})
@GetMapping(value = "/query-sub-by-parent")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result querySubProcessInstanceByTaskId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@RequestParam("taskId") Integer taskId) {
Map<String, Object> result =
processInstanceService.querySubProcessInstanceByTaskId(loginUser, projectCode, taskId);
return returnDataList(result);
}
/**
* query parent process instance detail info by sub process instance id
*
* @param loginUser login user
* @param projectCode project code
* @param subId sub process id
* @return parent instance detail
*/
@Operation(summary = "queryParentInstanceBySubId", description = "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES")
@Parameters({
@Parameter(name = "subId", description = "SUB_PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@GetMapping(value = "/query-parent-by-sub")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR)
@AccessLogAnnotation
public Result queryParentInstanceBySubId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam("subId") Integer subId) {
Map<String, Object> result = processInstanceService.queryParentInstanceBySubId(loginUser, projectCode, subId);
return returnDataList(result);
}
/**
* query process instance global variables and local variables
*
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
* @param loginUser login user
* @param id process instance id
* @return variables data
*/
@Operation(summary = "viewVariables", description = "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES")
@Parameters({
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@GetMapping(value = "/{id}/view-variables")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR)
@AccessLogAnnotation
public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable("id") Integer id) {
Map<String, Object> result = processInstanceService.viewVariables(projectCode, id);
return returnDataList(result);
}
/**
* encapsulation gantt structure
*
* @param loginUser login user
* @param projectCode project code
* @param id process instance id
* @return gantt tree data
*/
@Operation(summary = "vieGanttTree", description = "VIEW_GANTT_NOTES")
@Parameters({
@Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@GetMapping(value = "/{id}/view-gantt")
@ResponseStatus(HttpStatus.OK)
@ApiException(ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR)
@AccessLogAnnotation
public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable("id") Integer id) throws Exception {
Map<String, Object> result = processInstanceService.viewGantt(projectCode, id);
return returnDataList(result);
}
/**
* batch delete process instance by ids, at the same time,
* delete task instance and their mapping relation data
*
* @param loginUser login user
* @param projectCode project code
* @param processInstanceIds process instance id
* @return delete result code
*/
@Operation(summary = "batchDeleteProcessInstanceByIds", description = "BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = int.class)),
@Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema = @Schema(implementation = String.class)),
})
@PostMapping(value = "/batch-delete")
@ResponseStatus(HttpStatus.OK)
@ApiException(BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR)
@AccessLogAnnotation
public Result batchDeleteProcessInstanceByIds(@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable long projectCode,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java
|
@RequestParam("processInstanceIds") String processInstanceIds) {
Map<String, Object> result = new HashMap<>();
List<String> deleteFailedIdList = new ArrayList<>();
if (!StringUtils.isEmpty(processInstanceIds)) {
String[] processInstanceIdArray = processInstanceIds.split(Constants.COMMA);
for (String strProcessInstanceId : processInstanceIdArray) {
int processInstanceId = Integer.parseInt(strProcessInstanceId);
try {
Map<String, Object> deleteResult =
processInstanceService.deleteProcessInstanceById(loginUser, projectCode, processInstanceId);
if (!Status.SUCCESS.equals(deleteResult.get(Constants.STATUS))) {
deleteFailedIdList.add((String) deleteResult.get(Constants.MSG));
logger.error((String) deleteResult.get(Constants.MSG));
}
} catch (Exception e) {
deleteFailedIdList
.add(MessageFormat.format(Status.PROCESS_INSTANCE_ERROR.getMsg(), strProcessInstanceId));
}
}
}
if (!deleteFailedIdList.isEmpty()) {
putMsg(result, Status.BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR, String.join("\n", deleteFailedIdList));
} else {
putMsg(result, Status.SUCCESS);
}
return returnDataList(result);
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceV2Controller.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.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.*;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceQueryRequest;
import org.apache.dolphinscheduler.api.enums.ExecuteType;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceV2Controller.java
|
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.ExecutorService;
import org.apache.dolphinscheduler.api.service.ProcessInstanceService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* workflow instance controller
*/
@Tag(name = "WORKFLOW_INSTANCE_TAG_V2")
@RestController
@RequestMapping("/v2/workflow-instances")
public class WorkflowInstanceV2Controller extends BaseController {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceV2Controller.java
|
@Autowired
private ProcessInstanceService processInstanceService;
@Autowired
private ExecutorService execService;
/**
* query workflow instance list paging
* @param loginUser login user
* @param workflowInstanceQueryRequest workflowInstanceQueryRequest
* @return workflow instance list
*/
@Operation(summary = "queryWorkflowInstanceListPaging", description = "QUERY_PROCESS_INSTANCE_LIST_NOTES")
@GetMapping(consumes = {"application/json"})
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryWorkflowInstanceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestBody WorkflowInstanceQueryRequest workflowInstanceQueryRequest) {
Result result =
checkPageParams(workflowInstanceQueryRequest.getPageNo(), workflowInstanceQueryRequest.getPageSize());
if (!result.checkResult()) {
return result;
}
result = processInstanceService.queryProcessInstanceList(loginUser, workflowInstanceQueryRequest);
return result;
}
/**
* Query workflowInstance by id
*
* @param loginUser login user
* @param workflowInstanceId workflow instance id
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceV2Controller.java
|
* @return Result result object query
*/
@Operation(summary = "queryWorkflowInstanceById", description = "QUERY_WORKFLOW_INSTANCE_BY_ID")
@Parameters({
@Parameter(name = "workflowInstanceId", description = "WORKFLOW_INSTANCE_ID", schema = @Schema(implementation = Integer.class, example = "123456", required = true))
})
@GetMapping(value = "/{workflowInstanceId}")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_PROCESS_INSTANCE_BY_ID_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryWorkflowInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable("workflowInstanceId") Integer workflowInstanceId) {
Map<String, Object> result = processInstanceService.queryProcessInstanceById(loginUser, workflowInstanceId);
return returnDataList(result);
}
/**
* Delete workflowInstance by id
*
* @param loginUser login user
* @param workflowInstanceId workflow instance code
* @return Result result object delete
*/
@Operation(summary = "delete", description = "DELETE_WORKFLOWS_INSTANCE_NOTES")
@Parameters({
@Parameter(name = "workflowInstanceId", description = "WORKFLOW_INSTANCE_ID", schema = @Schema(implementation = Integer.class, example = "123456", required = true))
})
@DeleteMapping(value = "/{workflowInstanceId}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_PROCESS_DEFINE_BY_CODE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceV2Controller.java
|
public Result deleteWorkflowInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable("workflowInstanceId") Integer workflowInstanceId) {
processInstanceService.deleteProcessInstanceById(loginUser, workflowInstanceId);
return Result.success();
}
/**
* do action to workflow instance: pause, stop, repeat, recover from pause, recover from stop
*
* @param loginUser login user
* @param workflowInstanceId workflow instance id
* @param executeType execute type
* @return execute result code
*/
@Operation(summary = "execute", description = "EXECUTE_ACTION_TO_WORKFLOW_INSTANCE_NOTES")
@Parameters({
@Parameter(name = "workflowInstanceId", description = "WORKFLOW_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")),
@Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema = @Schema(implementation = ExecuteType.class))
})
@PostMapping(value = "/{workflowInstanceId}/execute/{executeType}")
@ResponseStatus(HttpStatus.OK)
@ApiException(EXECUTE_PROCESS_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable("workflowInstanceId") Integer workflowInstanceId,
@PathVariable("executeType") ExecuteType executeType) {
Map<String, Object> result = execService.execute(loginUser, workflowInstanceId, executeType);
return returnDataList(result);
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.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.api.service.impl;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.*;
import static org.apache.dolphinscheduler.api.enums.Status.PROCESS_INSTANCE_NOT_EXIST;
import static org.apache.dolphinscheduler.api.enums.Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR;
import static org.apache.dolphinscheduler.common.constants.Constants.DATA_LIST;
import static org.apache.dolphinscheduler.common.constants.Constants.DEPENDENT_SPLIT;
import static org.apache.dolphinscheduler.common.constants.Constants.GLOBAL_PARAMS;
import static org.apache.dolphinscheduler.common.constants.Constants.LOCAL_PARAMS;
import static org.apache.dolphinscheduler.common.constants.Constants.PROCESS_INSTANCE_STATE;
import static org.apache.dolphinscheduler.common.constants.Constants.TASK_LIST;
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_DEPENDENT;
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_SUB_PROCESS;
import org.apache.dolphinscheduler.api.dto.gantt.GanttDto;
import org.apache.dolphinscheduler.api.dto.gantt.Task;
import org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceQueryRequest;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.service.ExecutorService;
import org.apache.dolphinscheduler.api.service.LoggerService;
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
import org.apache.dolphinscheduler.api.service.ProcessInstanceService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.service.UsersService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
import org.apache.dolphinscheduler.common.graph.DAG;
import org.apache.dolphinscheduler.common.model.TaskNodeRelation;
import org.apache.dolphinscheduler.common.utils.DateUtils;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.placeholder.BusinessTimeUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.ResponseTaskLog;
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.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
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.repository.ProcessInstanceDao;
import org.apache.dolphinscheduler.dao.repository.TaskInstanceDao;
import org.apache.dolphinscheduler.dao.utils.WorkflowUtils;
import org.apache.dolphinscheduler.plugin.task.api.enums.DependResult;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;
import org.apache.dolphinscheduler.service.expand.CuringParamsService;
import org.apache.dolphinscheduler.service.model.TaskNode;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.task.TaskPluginManager;
import org.apache.commons.lang3.StringUtils;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* process instance service impl
*/
@Service
public class ProcessInstanceServiceImpl extends BaseServiceImpl implements ProcessInstanceService {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
private static final Logger logger = LoggerFactory.getLogger(ProcessInstanceServiceImpl.class);
public static final String TASK_TYPE = "taskType";
public static final String LOCAL_PARAMS_LIST = "localParamsList";
@Autowired
ProjectMapper projectMapper;
@Autowired
ProjectService projectService;
@Autowired
ProcessService processService;
@Autowired
TaskInstanceDao taskInstanceDao;
@Autowired
ProcessInstanceMapper processInstanceMapper;
@Autowired
ProcessInstanceDao processInstanceDao;
@Autowired
ProcessDefinitionMapper processDefineMapper;
@Autowired
ProcessDefinitionService processDefinitionService;
@Autowired
ExecutorService execService;
@Autowired
TaskInstanceMapper taskInstanceMapper;
@Autowired
LoggerService loggerService;
@Autowired
ProcessDefinitionLogMapper processDefinitionLogMapper;
@Autowired
TaskDefinitionLogMapper taskDefinitionLogMapper;
@Autowired
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
UsersService usersService;
@Autowired
private TenantMapper tenantMapper;
@Autowired
TaskDefinitionMapper taskDefinitionMapper;
@Autowired
private TaskPluginManager taskPluginManager;
@Autowired
private ScheduleMapper scheduleMapper;
@Autowired
private CuringParamsService curingGlobalParamsService;
/**
* return top n SUCCESS process instance order by running time which started between startTime and endTime
*/
@Override
public Map<String, Object> queryTopNLongestRunningProcessInstance(User loginUser, long projectCode, int size,
String startTime, String endTime) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (0 > size) {
putMsg(result, Status.NEGTIVE_SIZE_NUMBER_ERROR, size);
return result;
}
if (Objects.isNull(startTime)) {
putMsg(result, Status.DATA_IS_NULL, Constants.START_TIME);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
return result;
}
Date start = DateUtils.stringToDate(startTime);
if (Objects.isNull(endTime)) {
putMsg(result, Status.DATA_IS_NULL, Constants.END_TIME);
return result;
}
Date end = DateUtils.stringToDate(endTime);
if (start == null || end == null) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.START_END_DATE);
return result;
}
if (start.getTime() > end.getTime()) {
putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR, startTime, endTime);
return result;
}
List<ProcessInstance> processInstances = processInstanceMapper.queryTopNProcessInstance(size, start, end,
WorkflowExecutionStatus.SUCCESS, projectCode);
result.put(DATA_LIST, processInstances);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query process instance by id
*
* @param loginUser login user
* @param projectCode project code
* @param processId process instance id
* @return process instance detail
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
@Override
public Map<String, Object> queryProcessInstanceById(User loginUser, long projectCode, Integer processId) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, processId));
ProcessDefinition processDefinition =
processService.findProcessDefinition(processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}.", projectCode);
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processId);
} else {
Tenant tenant = tenantMapper.queryById(processDefinition.getTenantId());
if (tenant != null) {
processDefinition.setTenantCode(tenant.getTenantCode());
}
processInstance.setLocations(processDefinition.getLocations());
processInstance.setDagData(processService.genDagData(processDefinition));
result.put(DATA_LIST, processInstance);
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
* query workflow instance by id
*
* @param loginUser login user
* @param workflowInstanceId workflow instance id
* @return workflow instance detail
*/
@Override
public Map<String, Object> queryProcessInstanceById(User loginUser, Integer workflowInstanceId) {
ProcessInstance processInstance = processInstanceMapper.selectById(workflowInstanceId);
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
return queryProcessInstanceById(loginUser, processDefinition.getProjectCode(), workflowInstanceId);
}
/**
* paging query process instance list, filtering according to project, process definition, time range, keyword, process status
*
* @param loginUser login user
* @param projectCode project code
* @param processDefineCode process definition code
* @param pageNo page number
* @param pageSize page size
* @param searchVal search value
* @param stateType state type
* @param host host
* @param startDate start time
* @param endDate end time
* @param otherParamsJson otherParamsJson handle other params
* @return process instance list
*/
@Override
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
public Result queryProcessInstanceList(User loginUser, long projectCode, long processDefineCode, String startDate,
String endDate, String searchVal, String executorName,
WorkflowExecutionStatus stateType, String host, String otherParamsJson,
Integer pageNo, Integer pageSize) {
Result result = new Result();
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> checkResult =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
Status resultEnum = (Status) checkResult.get(Constants.STATUS);
if (resultEnum != Status.SUCCESS) {
putMsg(result, resultEnum);
return result;
}
int[] statusArray = null;
if (stateType != null) {
statusArray = new int[]{stateType.getCode()};
}
Map<String, Object> checkAndParseDateResult = checkAndParseDateParameters(startDate, endDate);
resultEnum = (Status) checkAndParseDateResult.get(Constants.STATUS);
if (resultEnum != Status.SUCCESS) {
putMsg(result, resultEnum);
return result;
}
Date start = (Date) checkAndParseDateResult.get(Constants.START_TIME);
Date end = (Date) checkAndParseDateResult.get(Constants.END_TIME);
Page<ProcessInstance> page = new Page<>(pageNo, pageSize);
PageInfo<ProcessInstance> pageInfo = new PageInfo<>(pageNo, pageSize);
int executorId = usersService.getUserIdByName(executorName);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
IPage<ProcessInstance> processInstanceList = processInstanceMapper.queryProcessInstanceListPaging(page,
project.getCode(), processDefineCode, searchVal, executorId, statusArray, host, start, end);
List<ProcessInstance> processInstances = processInstanceList.getRecords();
List<Integer> userIds = Collections.emptyList();
if (CollectionUtils.isNotEmpty(processInstances)) {
userIds = processInstances.stream().map(ProcessInstance::getExecutorId).collect(Collectors.toList());
}
List<User> users = usersService.queryUser(userIds);
Map<Integer, User> idToUserMap = Collections.emptyMap();
if (CollectionUtils.isNotEmpty(users)) {
idToUserMap = users.stream().collect(Collectors.toMap(User::getId, Function.identity()));
}
for (ProcessInstance processInstance : processInstances) {
processInstance.setDuration(WorkflowUtils.getWorkflowInstanceDuration(processInstance));
User executor = idToUserMap.get(processInstance.getExecutorId());
if (null != executor) {
processInstance.setExecutorName(executor.getUserName());
}
}
pageInfo.setTotal((int) processInstanceList.getTotal());
pageInfo.setTotalList(processInstances);
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* paging query process instance list, filtering according to project, process definition, time range, keyword, process status
*
* @param loginUser login user
* @param workflowInstanceQueryRequest workflowInstanceQueryRequest
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
* @return process instance list
*/
@Override
public Result queryProcessInstanceList(User loginUser, WorkflowInstanceQueryRequest workflowInstanceQueryRequest) {
Result result = new Result();
ProcessInstance processInstance = workflowInstanceQueryRequest.convert2ProcessInstance();
String projectName = workflowInstanceQueryRequest.getProjectName();
if (!StringUtils.isBlank(projectName)) {
Project project = projectMapper.queryByName(projectName);
projectService.checkProjectAndAuthThrowException(loginUser, project, WORKFLOW_DEFINITION);
ProcessDefinition processDefinition =
processDefineMapper.queryByDefineName(project.getCode(), processInstance.getName());
processInstance.setProcessDefinitionCode(processDefinition.getCode());
}
Page<ProcessInstance> page =
new Page<>(workflowInstanceQueryRequest.getPageNo(), workflowInstanceQueryRequest.getPageSize());
PageInfo<ProcessInstance> pageInfo =
new PageInfo<>(workflowInstanceQueryRequest.getPageNo(), workflowInstanceQueryRequest.getPageSize());
IPage<ProcessInstance> processInstanceList = processInstanceMapper.queryProcessInstanceListV2Paging(page,
processInstance.getProcessDefinitionCode(), processInstance.getName(),
workflowInstanceQueryRequest.getStartTime(), workflowInstanceQueryRequest.getEndTime(),
workflowInstanceQueryRequest.getState(), processInstance.getHost());
List<ProcessInstance> processInstances = processInstanceList.getRecords();
List<Integer> userIds = Collections.emptyList();
if (CollectionUtils.isNotEmpty(processInstances)) {
userIds = processInstances.stream().map(ProcessInstance::getExecutorId).collect(Collectors.toList());
}
List<User> users = usersService.queryUser(userIds);
Map<Integer, User> idToUserMap = Collections.emptyMap();
if (CollectionUtils.isNotEmpty(users)) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
idToUserMap = users.stream().collect(Collectors.toMap(User::getId, Function.identity()));
}
for (ProcessInstance Instance : processInstances) {
Instance.setDuration(WorkflowUtils.getWorkflowInstanceDuration(Instance));
User executor = idToUserMap.get(Instance.getExecutorId());
if (null != executor) {
Instance.setExecutorName(executor.getUserName());
}
}
pageInfo.setTotal((int) processInstanceList.getTotal());
pageInfo.setTotalList(processInstances);
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query task list by process instance id
*
* @param loginUser login user
* @param projectCode project code
* @param processId process instance id
* @return task list for the process instance
* @throws IOException io exception
*/
@Override
public Map<String, Object> queryTaskListByProcessId(User loginUser, long projectCode,
Integer processId) throws IOException {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, processId));
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
if (processDefinition != null && projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}, processDefinitionId:{}.", projectCode,
processId);
putMsg(result, PROCESS_INSTANCE_NOT_EXIST, processId);
return result;
}
List<TaskInstance> taskInstanceList =
taskInstanceDao.findValidTaskListByProcessId(processId, processInstance.getTestFlag());
addDependResultForTaskList(loginUser, taskInstanceList);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put(PROCESS_INSTANCE_STATE, processInstance.getState().toString());
resultMap.put(TASK_LIST, taskInstanceList);
result.put(DATA_LIST, resultMap);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* add dependent result for dependent task
*/
private void addDependResultForTaskList(User loginUser, List<TaskInstance> taskInstanceList) throws IOException {
for (TaskInstance taskInstance : taskInstanceList) {
if (TASK_TYPE_DEPENDENT.equalsIgnoreCase(taskInstance.getTaskType())) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
logger.info("DEPENDENT type task instance need to set dependent result, taskCode:{}, taskInstanceId:{}",
taskInstance.getTaskCode(), taskInstance.getId());
Result<ResponseTaskLog> logResult = loggerService.queryLog(loginUser,
taskInstance.getId(), Constants.LOG_QUERY_SKIP_LINE_NUMBER, Constants.LOG_QUERY_LIMIT);
if (logResult.getCode() == Status.SUCCESS.ordinal()) {
String log = logResult.getData().getMessage();
Map<String, DependResult> resultMap = parseLogForDependentResult(log);
taskInstance.setDependentResult(JSONUtils.toJsonString(resultMap));
}
}
}
}
@Override
public Map<String, DependResult> parseLogForDependentResult(String log) throws IOException {
Map<String, DependResult> resultMap = new HashMap<>();
if (StringUtils.isEmpty(log)) {
logger.warn("Log content is empty.");
return resultMap;
}
BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(log.getBytes(
StandardCharsets.UTF_8)), StandardCharsets.UTF_8));
String line;
while ((line = br.readLine()) != null) {
if (line.contains(DEPENDENT_SPLIT)) {
String[] tmpStringArray = line.split(":\\|\\|");
if (tmpStringArray.length != 2) {
continue;
}
String dependResultString = tmpStringArray[1];
String[] dependStringArray = dependResultString.split(",");
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
if (dependStringArray.length != 2) {
continue;
}
String key = dependStringArray[0].trim();
DependResult dependResult = DependResult.valueOf(dependStringArray[1].trim());
resultMap.put(key, dependResult);
}
}
return resultMap;
}
/**
* query sub process instance detail info by task id
*
* @param loginUser login user
* @param projectCode project code
* @param taskId task id
* @return sub process instance detail
*/
@Override
public Map<String, Object> querySubProcessInstanceByTaskId(User loginUser, long projectCode, Integer taskId) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
TaskInstance taskInstance = taskInstanceDao.findTaskInstanceById(taskId);
if (taskInstance == null) {
logger.error("Task instance does not exist, projectCode:{}, taskInstanceId{}.", projectCode, taskId);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
putMsg(result, Status.TASK_INSTANCE_NOT_EXISTS, taskId);
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskInstance.getTaskCode());
if (taskDefinition != null && projectCode != taskDefinition.getProjectCode()) {
logger.error("Task definition does not exist, projectCode:{}, taskDefinitionCode:{}.", projectCode,
taskInstance.getTaskCode());
putMsg(result, Status.TASK_INSTANCE_NOT_EXISTS, taskId);
return result;
}
if (!taskInstance.isSubProcess()) {
logger.warn("Task instance is not {} type instance, projectCode:{}, taskInstanceId:{}.",
TASK_TYPE_SUB_PROCESS, projectCode, taskId);
putMsg(result, Status.TASK_INSTANCE_NOT_SUB_WORKFLOW_INSTANCE, taskInstance.getName());
return result;
}
ProcessInstance subWorkflowInstance = processService.findSubProcessInstance(
taskInstance.getProcessInstanceId(), taskInstance.getId());
if (subWorkflowInstance == null) {
logger.error("SubProcess instance does not exist, projectCode:{}, taskInstanceId:{}.", projectCode,
taskInstance.getId());
putMsg(result, Status.SUB_PROCESS_INSTANCE_NOT_EXIST, taskId);
return result;
}
Map<String, Object> dataMap = new HashMap<>();
dataMap.put(Constants.SUBPROCESS_INSTANCE_ID, subWorkflowInstance.getId());
result.put(DATA_LIST, dataMap);
putMsg(result, Status.SUCCESS);
return result;
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
/**
* update process instance
*
* @param loginUser login user
* @param projectCode project code
* @param taskRelationJson process task relation json
* @param taskDefinitionJson taskDefinitionJson
* @param processInstanceId process instance id
* @param scheduleTime schedule time
* @param syncDefine sync define
* @param globalParams g
* @param locations locations for nodes
* @param timeout timeout
* @param tenantCode tenantCode
* @return update result code
*/
@Transactional
@Override
public Map<String, Object> updateProcessInstance(User loginUser, long projectCode, Integer processInstanceId,
String taskRelationJson,
String taskDefinitionJson, String scheduleTime, Boolean syncDefine,
String globalParams,
String locations, int timeout, String tenantCode) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, INSTANCE_UPDATE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, processInstanceId));
ProcessDefinition processDefinition0 =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
if (processDefinition0 != null && projectCode != processDefinition0.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}, processDefinitionCode:{}.", projectCode,
processInstance.getProcessDefinitionCode());
putMsg(result, PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
if (!processInstance.getState().isFinished()) {
logger.warn("Process Instance state is {} so can not update process instance, processInstanceId:{}.",
processInstance.getState().getDesc(), processInstanceId);
putMsg(result, PROCESS_INSTANCE_STATE_OPERATION_ERROR,
processInstance.getName(), processInstance.getState().toString(), "update");
return result;
}
Map<String, String> commandParamMap = JSONUtils.toMap(processInstance.getCommandParam());
String timezoneId = null;
if (commandParamMap == null || StringUtils.isBlank(commandParamMap.get(Constants.SCHEDULE_TIMEZONE))) {
timezoneId = loginUser.getTimeZone();
} else {
timezoneId = commandParamMap.get(Constants.SCHEDULE_TIMEZONE);
}
setProcessInstance(processInstance, tenantCode, scheduleTime, globalParams, timeout, timezoneId);
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
if (taskDefinitionLogs.isEmpty()) {
logger.warn("Parameter taskDefinitionJson is empty");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson);
return result;
}
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinitionLog.getTaskType())
.taskParams(taskDefinitionLog.getTaskParams())
.dependence(taskDefinitionLog.getDependence())
.build())) {
logger.error("Task parameters are invalid, taskDefinitionName:{}.", taskDefinitionLog.getName());
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName());
return result;
}
}
int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs, syncDefine);
if (saveTaskResult == Constants.DEFINITION_FAILURE) {
logger.error("Update task definition error, projectCode:{}, processInstanceId:{}", projectCode,
processInstanceId);
putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR);
}
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
List<ProcessTaskRelationLog> taskRelationList =
JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class);
result = processDefinitionService.checkProcessNodeList(taskRelationJson, taskDefinitionLogs);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
return result;
}
int tenantId = -1;
if (!Constants.DEFAULT.equals(tenantCode)) {
Tenant tenant = tenantMapper.queryByTenantCode(tenantCode);
if (tenant == null) {
logger.error("Tenant does not exist.");
putMsg(result, Status.TENANT_NOT_EXIST);
return result;
}
tenantId = tenant.getId();
}
processDefinition.set(projectCode, processDefinition.getName(), processDefinition.getDescription(),
globalParams, locations, timeout, tenantId);
processDefinition.setUpdateTime(new Date());
int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, syncDefine, Boolean.FALSE);
if (insertVersion == 0) {
logger.error("Update process definition error, projectCode:{}, processDefinitionName:{}.", projectCode,
processDefinition.getName());
putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR);
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR);
} else
logger.info("Update process definition complete, projectCode:{}, processDefinitionName:{}.", projectCode,
processDefinition.getName());
int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(),
processDefinition.getCode(), insertVersion, taskRelationList, taskDefinitionLogs, syncDefine);
if (insertResult == Constants.EXIT_CODE_SUCCESS) {
logger.info(
"Update task relations complete, projectCode:{}, processDefinitionCode:{}, processDefinitionVersion:{}.",
projectCode, processDefinition.getCode(), insertVersion);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, processDefinition);
} else {
logger.info(
"Update task relations error, projectCode:{}, processDefinitionCode:{}, processDefinitionVersion:{}.",
projectCode, processDefinition.getCode(), insertVersion);
putMsg(result, Status.UPDATE_PROCESS_DEFINITION_ERROR);
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR);
}
processInstance.setProcessDefinitionVersion(insertVersion);
int update = processInstanceDao.updateProcessInstance(processInstance);
if (update == 0) {
logger.error(
"Update process instance version error, projectCode:{}, processDefinitionCode:{}, processDefinitionVersion:{}",
projectCode, processDefinition.getCode(), insertVersion);
putMsg(result, Status.UPDATE_PROCESS_INSTANCE_ERROR);
throw new ServiceException(Status.UPDATE_PROCESS_INSTANCE_ERROR);
}
logger.info(
"Update process instance complete, projectCode:{}, processDefinitionCode:{}, processDefinitionVersion:{}, processInstanceId:{}",
projectCode, processDefinition.getCode(), insertVersion, processInstanceId);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* update process instance attributes
*/
private void setProcessInstance(ProcessInstance processInstance, String tenantCode, String scheduleTime,
String globalParams, int timeout, String timezone) {
Date schedule = processInstance.getScheduleTime();
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
if (scheduleTime != null) {
schedule = DateUtils.stringToDate(scheduleTime);
}
processInstance.setScheduleTime(schedule);
List<Property> globalParamList = JSONUtils.toList(globalParams, Property.class);
Map<String, String> globalParamMap =
globalParamList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue));
globalParams = curingGlobalParamsService.curingGlobalParams(processInstance.getId(), globalParamMap,
globalParamList, processInstance.getCmdTypeIfComplement(), schedule, timezone);
processInstance.setTimeout(timeout);
processInstance.setTenantCode(tenantCode);
processInstance.setGlobalParams(globalParams);
}
/**
* query parent process instance detail info by sub process instance id
*
* @param loginUser login user
* @param projectCode project code
* @param subId sub process id
* @return parent instance detail
*/
@Override
public Map<String, Object> queryParentInstanceBySubId(User loginUser, long projectCode, Integer subId) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_INSTANCE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
ProcessInstance subInstance = processService.findProcessInstanceDetailById(subId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, subId));
if (subInstance.getIsSubProcess() == Flag.NO) {
logger.warn(
"Process instance is not sub process instance type, processInstanceId:{}, processInstanceName:{}.",
subId, subInstance.getName());
putMsg(result, Status.PROCESS_INSTANCE_NOT_SUB_PROCESS_INSTANCE, subInstance.getName());
return result;
}
ProcessInstance parentWorkflowInstance = processService.findParentProcessInstance(subId);
if (parentWorkflowInstance == null) {
logger.error("Parent process instance does not exist, projectCode:{}, subProcessInstanceId:{}.",
projectCode, subId);
putMsg(result, Status.SUB_PROCESS_INSTANCE_NOT_EXIST);
return result;
}
Map<String, Object> dataMap = new HashMap<>();
dataMap.put(Constants.PARENT_WORKFLOW_INSTANCE, parentWorkflowInstance.getId());
result.put(DATA_LIST, dataMap);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* delete process instance by id, at the same time,delete task instance and their mapping relation data
*
* @param loginUser login user
* @param projectCode project code
* @param processInstanceId process instance id
* @return delete result code
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
@Override
@Transactional
public Map<String, Object> deleteProcessInstanceById(User loginUser, long projectCode, Integer processInstanceId) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, INSTANCE_DELETE);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, processInstanceId));
if (!processInstance.getState().isFinished()) {
logger.warn("Process Instance state is {} so can not delete process instance, processInstanceId:{}.",
processInstance.getState().getDesc(), processInstanceId);
throw new ServiceException(PROCESS_INSTANCE_STATE_OPERATION_ERROR, processInstance.getName(),
processInstance.getState(), "delete");
}
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
if (processDefinition != null && projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}, ProcessDefinitionCode:{}.",
projectCode, processInstance.getProcessDefinitionCode());
throw new ServiceException(PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
}
try {
processService.removeTaskLogFile(processInstanceId);
} catch (Exception ) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
logger.warn(
"Remove task log file exception, projectCode:{}, ProcessDefinitionCode{}, processInstanceId:{}.",
projectCode, processInstance.getProcessDefinitionCode(), processInstanceId);
}
int delete = processService.deleteWorkProcessInstanceById(processInstanceId);
processService.deleteAllSubWorkProcessByParentId(processInstanceId);
processService.deleteWorkProcessMapByParentId(processInstanceId);
processService.deleteWorkTaskInstanceByProcessInstanceId(processInstanceId);
if (delete > 0) {
logger.info(
"Delete process instance complete, projectCode:{}, ProcessDefinitionCode{}, processInstanceId:{}.",
projectCode, processInstance.getProcessDefinitionCode(), processInstanceId);
putMsg(result, Status.SUCCESS);
} else {
logger.error(
"Delete process instance error, projectCode:{}, ProcessDefinitionCode{}, processInstanceId:{}.",
projectCode, processInstance.getProcessDefinitionCode(), processInstanceId);
putMsg(result, Status.DELETE_PROCESS_INSTANCE_BY_ID_ERROR);
throw new ServiceException(Status.DELETE_PROCESS_INSTANCE_BY_ID_ERROR);
}
return result;
}
/**
* delete workflow instance by id, at the same time,delete task instance and their mapping relation data
*
* @param loginUser login user
* @param workflowInstanceId workflow instance id
* @return delete result code
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
@Override
public Map<String, Object> deleteProcessInstanceById(User loginUser, Integer workflowInstanceId) {
ProcessInstance processInstance = processService.findProcessInstanceDetailById(workflowInstanceId)
.orElseThrow(() -> new ServiceException(PROCESS_INSTANCE_NOT_EXIST, workflowInstanceId));
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
return deleteProcessInstanceById(loginUser, processDefinition.getProjectCode(), workflowInstanceId);
}
/**
* view process instance variables
*
* @param projectCode project code
* @param processInstanceId process instance id
* @return variables data
*/
@Override
public Map<String, Object> viewVariables(long projectCode, Integer processInstanceId) {
Map<String, Object> result = new HashMap<>();
ProcessInstance processInstance = processInstanceMapper.queryDetailById(processInstanceId);
if (processInstance == null) {
logger.error("Process instance does not exist, projectCode:{}, processInstanceId:{}.", projectCode,
processInstanceId);
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
ProcessDefinition processDefinition =
processDefineMapper.queryByCode(processInstance.getProcessDefinitionCode());
if (processDefinition != null && projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}, processDefinitionCode:{}.", projectCode,
processInstance.getProcessDefinitionCode());
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
putMsg(result, PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
Map<String, String> commandParam = JSONUtils.toMap(processInstance.getCommandParam());
String timezone = null;
if (commandParam != null) {
timezone = commandParam.get(Constants.SCHEDULE_TIMEZONE);
}
Map<String, String> timeParams = BusinessTimeUtils
.getBusinessTime(processInstance.getCmdTypeIfComplement(),
processInstance.getScheduleTime(), timezone);
String userDefinedParams = processInstance.getGlobalParams();
g
List<Property> globalParams = new ArrayList<>();
g
String globalParamStr =
ParameterUtils.convertParameterPlaceholders(JSONUtils.toJsonString(globalParams), timeParams);
globalParams = JSONUtils.toList(globalParamStr, Property.class);
for (Property property : globalParams) {
timeParams.put(property.getProp(), property.getValue());
}
if (userDefinedParams != null && userDefinedParams.length() > 0) {
globalParams = JSONUtils.toList(userDefinedParams, Property.class);
}
Map<String, Map<String, Object>> localUserDefParams = getLocalParams(processInstance, timeParams);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put(GLOBAL_PARAMS, globalParams);
resultMap.put(LOCAL_PARAMS, localUserDefParams);
result.put(DATA_LIST, resultMap);
putMsg(result, Status.SUCCESS);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
return result;
}
/**
* get local params
*/
private Map<String, Map<String, Object>> getLocalParams(ProcessInstance processInstance,
Map<String, String> timeParams) {
Map<String, Map<String, Object>> localUserDefParams = new HashMap<>();
List<TaskInstance> taskInstanceList =
taskInstanceMapper.findValidTaskListByProcessId(processInstance.getId(), Flag.YES,
processInstance.getTestFlag());
for (TaskInstance taskInstance : taskInstanceList) {
TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(
taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion());
String localParams = JSONUtils.getNodeString(taskDefinitionLog.getTaskParams(), LOCAL_PARAMS);
if (!StringUtils.isEmpty(localParams)) {
localParams = ParameterUtils.convertParameterPlaceholders(localParams, timeParams);
List<Property> localParamsList = JSONUtils.toList(localParams, Property.class);
Map<String, Object> localParamsMap = new HashMap<>();
localParamsMap.put(TASK_TYPE, taskDefinitionLog.getTaskType());
localParamsMap.put(LOCAL_PARAMS_LIST, localParamsList);
if (CollectionUtils.isNotEmpty(localParamsList)) {
localUserDefParams.put(taskDefinitionLog.getName(), localParamsMap);
}
}
}
return localUserDefParams;
}
/**
* encapsulation gantt structure
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
*
* @param projectCode project code
* @param processInstanceId process instance id
* @return gantt tree data
* @throws Exception exception when json parse
*/
@Override
public Map<String, Object> viewGantt(long projectCode, Integer processInstanceId) throws Exception {
Map<String, Object> result = new HashMap<>();
ProcessInstance processInstance = processInstanceMapper.queryDetailById(processInstanceId);
if (processInstance == null) {
logger.error("Process instance does not exist, projectCode:{}, processInstanceId:{}.", projectCode,
processInstanceId);
putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
ProcessDefinition processDefinition = processDefinitionLogMapper.queryByDefinitionCodeAndVersion(
processInstance.getProcessDefinitionCode(),
processInstance.getProcessDefinitionVersion());
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, projectCode:{}, processDefinitionCode:{}.", projectCode,
processInstance.getProcessDefinitionCode());
putMsg(result, PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
return result;
}
GanttDto ganttDto = new GanttDto();
DAG<String, TaskNode, TaskNodeRelation> dag = processService.genDagGraph(processDefinition);
t
List<String> nodeList = dag.topologicalSort();
ganttDto.setTaskNames(nodeList);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
List<Task> taskList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(nodeList)) {
List<Long> taskCodes = nodeList.stream().map(Long::parseLong).collect(Collectors.toList());
List<TaskInstance> taskInstances = taskInstanceMapper.queryByProcessInstanceIdsAndTaskCodes(
Collections.singletonList(processInstanceId), taskCodes);
for (String node : nodeList) {
TaskInstance taskInstance = null;
for (TaskInstance instance : taskInstances) {
if (instance.getProcessInstanceId() == processInstanceId
&& instance.getTaskCode() == Long.parseLong(node)) {
taskInstance = instance;
break;
}
}
if (taskInstance == null) {
continue;
}
Date startTime = taskInstance.getStartTime() == null ? new Date() : taskInstance.getStartTime();
Date endTime = taskInstance.getEndTime() == null ? new Date() : taskInstance.getEndTime();
Task task = new Task();
task.setTaskName(taskInstance.getName());
task.getStartDate().add(startTime.getTime());
task.getEndDate().add(endTime.getTime());
task.setIsoStart(startTime);
task.setIsoEnd(endTime);
task.setStatus(taskInstance.getState().getDesc().toUpperCase());
task.setExecutionDate(taskInstance.getStartTime());
task.setDuration(DateUtils.format2Readable(endTime.getTime() - startTime.getTime()));
taskList.add(task);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
|
}
ganttDto.setTasks(taskList);
result.put(DATA_LIST, ganttDto);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query process instance by processDefinitionCode and stateArray
*
* @param processDefinitionCode processDefinitionCode
* @param states states array
* @return process instance list
*/
@Override
public List<ProcessInstance> queryByProcessDefineCodeAndStatus(Long processDefinitionCode, int[] states) {
return processInstanceMapper.queryByProcessDefineCodeAndStatus(processDefinitionCode, states);
}
/**
* query process instance by processDefinitionCode
*
* @param processDefinitionCode processDefinitionCode
* @param size size
* @return process instance list
*/
@Override
public List<ProcessInstance> queryByProcessDefineCode(Long processDefinitionCode, int size) {
return processInstanceMapper.queryByProcessDefineCode(processDefinitionCode, size);
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceV2ControllerTest.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.api.controller;
import static org.mockito.ArgumentMatchers.*;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceV2ControllerTest.java
|
import static org.mockito.Mockito.when;
import org.apache.dolphinscheduler.api.dto.taskInstance.TaskInstanceQueryRequest;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.TaskInstanceService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.plugin.task.api.enums.TaskExecutionStatus;
import java.util.Collections;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
public class TaskInstanceV2ControllerTest extends AbstractControllerTest {
@InjectMocks
private TaskInstanceV2Controller taskInstanceV2Controller;
@Mock
private TaskInstanceService taskInstanceService;
@Test
public void testQueryTaskListPaging() {
TaskInstanceQueryRequest taskInstanceQueryReq = new TaskInstanceQueryRequest();
taskInstanceQueryReq.setProcessInstanceId(1);
taskInstanceQueryReq.setProcessInstanceName("");
taskInstanceQueryReq.setProcessDefinitionName("");
taskInstanceQueryReq.setTaskName("");
taskInstanceQueryReq.setExecutorName("");
taskInstanceQueryReq.setStartTime("2022-06-01 00:00:00");
taskInstanceQueryReq.setEndTime("2022-09-01 00:00:00");
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceV2ControllerTest.java
|
taskInstanceQueryReq.setSearchVal("");
taskInstanceQueryReq.setStateType(TaskExecutionStatus.SUCCESS);
taskInstanceQueryReq.setHost("127.0.0.1");
taskInstanceQueryReq.setTaskExecuteType(TaskExecuteType.BATCH);
taskInstanceQueryReq.setPageNo(1);
taskInstanceQueryReq.setPageSize(20);
Result result = new Result();
PageInfo<TaskInstance> pageInfo =
new PageInfo<>(taskInstanceQueryReq.getPageNo(), taskInstanceQueryReq.getPageSize());
pageInfo.setTotalList(Collections.singletonList(new TaskInstance()));
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(taskInstanceQueryReq.getProcessInstanceId()),
eq(taskInstanceQueryReq.getProcessInstanceName()), eq(taskInstanceQueryReq.getProcessInstanceName()),
eq(taskInstanceQueryReq.getTaskName()), eq(taskInstanceQueryReq.getExecutorName()), any(), any(),
eq(taskInstanceQueryReq.getSearchVal()), Mockito.any(), eq(taskInstanceQueryReq.getHost()),
eq(taskInstanceQueryReq.getTaskExecuteType()), any(), any())).thenReturn(result);
Result taskResult = taskInstanceV2Controller.queryTaskListPaging(null, 1L, taskInstanceQueryReq);
Assertions.assertEquals(Integer.valueOf(Status.SUCCESS.getCode()), taskResult.getCode());
}
@Test
public void testForceTaskSuccess() {
Result mockResult = new Result();
putMsg(mockResult, Status.SUCCESS);
when(taskInstanceService.forceTaskSuccess(any(), Mockito.anyLong(), Mockito.anyInt())).thenReturn(mockResult);
Result taskResult = taskInstanceV2Controller.forceTaskSuccess(null, 1L, 1);
Assertions.assertEquals(Integer.valueOf(Status.SUCCESS.getCode()), taskResult.getCode());
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.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
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
*/
package org.apache.dolphinscheduler.plugin.task.linkis;
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.*;
import org.apache.dolphinscheduler.plugin.task.api.AbstractRemoteTask;
import org.apache.dolphinscheduler.plugin.task.api.ShellCommandExecutor;
import org.apache.dolphinscheduler.plugin.task.api.TaskException;
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.model.TaskResponse;
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
import org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils;
import org.apache.dolphinscheduler.plugin.task.api.parser.ParameterUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* linkis task
*/
public class LinkisTask extends AbstractRemoteTask {
/**
* linkis parameters
*/
private LinkisParameters linkisParameters;
/**
* shell command executor
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
*/
private ShellCommandExecutor shellCommandExecutor;
/**
* taskExecutionContext
*/
protected final TaskExecutionContext taskExecutionContext;
private String taskId;
protected static final Pattern LINKIS_TASK_ID_REGEX = Pattern.compile(Constants.LINKIS_TASK_ID_REGEX);
protected static final Pattern LINKIS_STATUS_REGEX = Pattern.compile(Constants.LINKIS_STATUS_REGEX);
/**
* constructor
*
* @param taskExecutionContext taskExecutionContext
*/
public LinkisTask(TaskExecutionContext taskExecutionContext) {
super(taskExecutionContext);
this.taskExecutionContext = taskExecutionContext;
this.shellCommandExecutor = new ShellCommandExecutor(this::logHandle,
taskExecutionContext,
logger);
}
@Override
public List<String> getApplicationIds() throws TaskException {
return Collections.emptyList();
}
@Override
public void init() {
logger.info("Linkis task params {}", taskExecutionContext.getTaskParams());
if (!linkisParameters.checkParameters()) {
throw new RuntimeException("Linkis task params is not valid");
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
}
}
@Override
public void submitApplication() throws TaskException {
try {
String command = buildCommand();
TaskResponse commandExecuteResult = shellCommandExecutor.run(command);
setExitStatusCode(commandExecuteResult.getExitStatusCode());
setAppIds(findTaskId(commandExecuteResult.getResultString()));
setProcessId(commandExecuteResult.getProcessId());
linkisParameters.dealOutParam(shellCommandExecutor.getVarPool());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("The current Linkis task has been interrupted", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("The current Linkis task has been interrupted", e);
} catch (Exception e) {
logger.error("Linkis task error", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("Execute Linkis task failed", e);
}
}
@Override
public void trackApplicationStatus() throws TaskException {
initTaskId();
try {
List<String> args = new ArrayList<>();
args.add(Constants.SHELL_CLI_OPTIONS);
args.add(Constants.STATUS_OPTIONS);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
args.add(taskId);
String command = String.join(Constants.SPACE, args);
TaskResponse commandExecuteResult = shellCommandExecutor.run(command);
String status = findStatus(commandExecuteResult.getResultString());
LinkisJobStatus jobStatus = LinkisJobStatus.convertFromJobStatusString(status);
switch (jobStatus) {
case FAILED:
setExitStatusCode(EXIT_CODE_FAILURE);
break;
case SUCCEED:
setExitStatusCode(EXIT_CODE_SUCCESS);
break;
case CANCELLED:
setExitStatusCode(EXIT_CODE_KILL);
break;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("The current Linkis task has been interrupted", e);
throw new TaskException("The current Linkis task has been interrupted", e);
} catch (Exception e) {
throw new TaskException("track linkis status error", e);
}
}
@Override
public void cancelApplication() throws TaskException {
initTaskId();
try {
List<String> args = new ArrayList<>();
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
args.add(Constants.SHELL_CLI_OPTIONS);
args.add(Constants.KILL_OPTIONS);
args.add(taskId);
String command = String.join(Constants.SPACE, args);
shellCommandExecutor.run(command);
setExitStatusCode(EXIT_CODE_KILL);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("The current Linkis task has been interrupted", e);
throw new TaskException("The current Linkis task has been interrupted", e);
} catch (Exception e) {
throw new TaskException("cancel linkis task error", e);
}
}
private String buildCommand() {
List<String> args = new ArrayList<>();
args.addAll(buildOptions());
String command = String.join(Constants.SPACE, args);
logger.info("Linkis task command: {}", command);
return command;
}
protected List<String> buildOptions() {
List<String> args = new ArrayList<>();
args.add(Constants.SHELL_CLI_OPTIONS);
args.add(Constants.ASYNC_OPTIONS);
if (BooleanUtils.isTrue(linkisParameters.getUseCustom())) {
args.add(buildCustomConfigContent());
} else {
args.add(buildParamConfigContent());
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
return args;
}
private String buildCustomConfigContent() {
logger.info("raw custom config content : {}", linkisParameters.getRawScript());
String script = linkisParameters.getRawScript().replaceAll("\\r\\n", "\n");
script = parseScript(script);
return script;
}
private String buildParamConfigContent() {
logger.info("raw param config content : {}", linkisParameters.getParamScript());
String script = "";
List<LinkisParameters.Param> paramList = linkisParameters.getParamScript();
for (LinkisParameters.Param param : paramList) {
script = script.concat(param.getProps())
.concat(Constants.SPACE)
.concat(param.getValue());
}
script = parseScript(script);
return script;
}
private void initTaskId() {
if (taskId == null) {
if (StringUtils.isNotEmpty(getAppIds())) {
taskId = getAppIds();
}
}
if (taskId == null) {
throw new TaskException("linkis task id is null");
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,018 |
[Bug] [Style] `Wildcard imports check` fails to catch `import static xxx;\n`
|
### 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
* `Spotless wildcard imports check` fails to catch `import static xxx;\n`
* https://github.com/apache/dolphinscheduler/pull/12990#discussion_r1033161031
### What you expected to happen
* `import static xxx;\n` should be caught by CI.
### How to reproduce
* See the hyper link above.
### Anything else
_No response_
### Version
dev
### 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/13018
|
https://github.com/apache/dolphinscheduler/pull/13067
|
12a6138d3343a489069ddf98c48f61957801b167
|
c2ae76c0bd6a115164002cfff3be10e16aa0eeb9
| 2022-11-28T06:21:14Z |
java
| 2022-12-01T06:15:28Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java
|
protected String findTaskId(String line) {
Matcher matcher = LINKIS_TASK_ID_REGEX.matcher(line);
if (matcher.find()) {
String str = matcher.group();
return str.substring(11);
}
return null;
}
protected String findStatus(String line) {
Matcher matcher = LINKIS_STATUS_REGEX.matcher(line);
if (matcher.find()) {
String str = matcher.group();
return str.substring(11);
}
return null;
}
@Override
public AbstractParameters getParameters() {
return linkisParameters;
}
private String parseScript(String script) {
Map<String, Property> paramsMap = taskExecutionContext.getPrepareParamsMap();
return ParameterUtils.convertParameterPlaceholders(script, ParamUtils.convert(paramsMap));
}
public void setLinkisParameters(LinkisParameters linkisParameters) {
this.linkisParameters = linkisParameters;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/TaskRetryStateEventHandler.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.event;
import org.apache.dolphinscheduler.common.enums.StateEventType;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.server.master.metrics.TaskMetrics;
import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.auto.service.AutoService;
@AutoService(StateEventHandler.class)
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/TaskRetryStateEventHandler.java
|
public class TaskRetryStateEventHandler implements StateEventHandler {
private static final Logger logger = LoggerFactory.getLogger(TaskRetryStateEventHandler.class);
@Override
public boolean handleStateEvent(WorkflowExecuteRunnable workflowExecuteRunnable,
StateEvent stateEvent) throws StateEventHandleException {
TaskStateEvent taskStateEvent = (TaskStateEvent) stateEvent;
logger.info("Handle task instance retry event, taskInstanceId: {}", taskStateEvent.getTaskInstanceId());
TaskMetrics.incTaskInstanceByState("retry");
Map<Long, TaskInstance> waitToRetryTaskInstanceMap = workflowExecuteRunnable.getWaitToRetryTaskInstanceMap();
TaskInstance taskInstance = waitToRetryTaskInstanceMap.get(taskStateEvent.getTaskCode());
workflowExecuteRunnable.addTaskToStandByList(taskInstance);
workflowExecuteRunnable.submitStandByTask();
waitToRetryTaskInstanceMap.remove(taskStateEvent.getTaskCode());
return true;
}
@Override
public StateEventType getEventType() {
return StateEventType.TASK_RETRY;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.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;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.StateEventType;
import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
import org.apache.dolphinscheduler.common.lifecycle.ServerLifeCycleManager;
import org.apache.dolphinscheduler.common.thread.BaseDaemonThread;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.plugin.task.api.enums.TaskExecutionStatus;
import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager;
import org.apache.dolphinscheduler.server.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.master.event.TaskStateEvent;
import org.apache.dolphinscheduler.server.master.event.WorkflowStateEvent;
import org.apache.dolphinscheduler.server.master.runner.task.TaskInstanceKey;
import org.apache.dolphinscheduler.service.utils.LoggerUtils;
import java.util.Optional;
import java.util.concurrent.ConcurrentLinkedQueue;
import javax.annotation.PostConstruct;
import lombok.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
/**
* Check thread
* 1. timeout task check
* 2. dependent task state check
* 3. retry task check
* 4. timeout process check
*/
@Component
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
public class StateWheelExecuteThread extends BaseDaemonThread {
private static final Logger logger = LoggerFactory.getLogger(StateWheelExecuteThread.class);
/**
* ProcessInstance timeout check list, element is the processInstanceId.
*/
private final ConcurrentLinkedQueue<Integer> processInstanceTimeoutCheckList = new ConcurrentLinkedQueue<>();
/**
* task time out check list
*/
private final ConcurrentLinkedQueue<TaskInstanceKey> taskInstanceTimeoutCheckList = new ConcurrentLinkedQueue<>();
/**
* task retry check list
*/
private final ConcurrentLinkedQueue<TaskInstanceKey> taskInstanceRetryCheckList = new ConcurrentLinkedQueue<>();
/**
* task state check list
*/
private final ConcurrentLinkedQueue<TaskInstanceKey> taskInstanceStateCheckList = new ConcurrentLinkedQueue<>();
@Autowired
private MasterConfig masterConfig;
@Lazy
@Autowired
private WorkflowExecuteThreadPool workflowExecuteThreadPool;
@Autowired
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
private ProcessInstanceExecCacheManager processInstanceExecCacheManager;
protected StateWheelExecuteThread() {
super("StateWheelExecuteThread");
}
@PostConstruct
public void startWheelThread() {
super.start();
}
@Override
public void run() {
final long checkInterval = masterConfig.getStateWheelInterval().toMillis();
while (!ServerLifeCycleManager.isStopped()) {
try {
checkTask4Timeout();
checkTask4Retry();
checkTask4State();
checkProcess4Timeout();
} catch (Exception e) {
logger.error("state wheel thread check error:", e);
}
try {
Thread.sleep(checkInterval);
} catch (InterruptedException e) {
logger.error("state wheel thread sleep error, will close the loop", e);
Thread.currentThread().interrupt();
break;
}
}
}
public void addProcess4TimeoutCheck(ProcessInstance processInstance) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
processInstanceTimeoutCheckList.add(processInstance.getId());
logger.info("Success add workflow instance {} into timeout check list", processInstance.getId());
}
public void removeProcess4TimeoutCheck(int processInstanceId) {
boolean removeFlag = processInstanceTimeoutCheckList.remove(processInstanceId);
if (removeFlag) {
logger.info("Success remove workflow instance {} from timeout check list", processInstanceId);
}
}
private void checkProcess4Timeout() {
if (processInstanceTimeoutCheckList.isEmpty()) {
return;
}
for (Integer processInstanceId : processInstanceTimeoutCheckList) {
try {
LoggerUtils.setWorkflowInstanceIdMDC(processInstanceId);
WorkflowExecuteRunnable workflowExecuteThread = processInstanceExecCacheManager.getByProcessInstanceId(
processInstanceId);
if (workflowExecuteThread == null) {
logger.warn(
"Check workflow timeout failed, can not find workflowExecuteThread from cache manager, will remove this workflowInstance from check list");
processInstanceTimeoutCheckList.remove(processInstanceId);
continue;
}
ProcessInstance processInstance = workflowExecuteThread.getProcessInstance();
if (processInstance == null) {
logger.warn("Check workflow timeout failed, the workflowInstance is null");
continue;
}
long timeRemain = DateUtils.getRemainTime(processInstance.getStartTime(),
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
(long) processInstance.getTimeout()
* Constants.SEC_2_MINUTES_TIME_UNIT);
if (timeRemain < 0) {
logger.info("Workflow instance {} timeout, adding timeout event", processInstance.getId());
addProcessTimeoutEvent(processInstance);
processInstanceTimeoutCheckList.remove(processInstance.getId());
logger.info("Workflow instance timeout, added timeout event");
}
} catch (Exception ex) {
logger.error("Check workflow instance timeout error");
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
}
}
}
public void addTask4TimeoutCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
logger.info("Adding task instance into timeout check list");
if (taskInstanceTimeoutCheckList.contains(taskInstanceKey)) {
logger.warn("Task instance is already in timeout check list");
return;
}
TaskDefinition taskDefinition = taskInstance.getTaskDefine();
if (taskDefinition == null) {
logger.error("Failed to add task instance into timeout check list, taskDefinition is null");
return;
}
if (TimeoutFlag.OPEN == taskDefinition.getTimeoutFlag()) {
taskInstanceTimeoutCheckList.add(taskInstanceKey);
logger.info("Timeout flag is open, added task instance into timeout check list");
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
}
if (taskInstance.isDependTask() || taskInstance.isSubProcess()) {
taskInstanceTimeoutCheckList.add(taskInstanceKey);
logger.info("task instance is dependTask orSubProcess, added task instance into timeout check list");
}
}
public void removeTask4TimeoutCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
taskInstanceTimeoutCheckList.remove(taskInstanceKey);
logger.info("remove task instance from timeout check list");
}
public void addTask4RetryCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
logger.info("Adding task instance into retry check list");
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
if (taskInstanceRetryCheckList.contains(taskInstanceKey)) {
logger.warn("Task instance is already in retry check list");
return;
}
TaskDefinition taskDefinition = taskInstance.getTaskDefine();
if (taskDefinition == null) {
logger.error("Add task instance into retry check list error, taskDefinition is null");
return;
}
taskInstanceRetryCheckList.add(taskInstanceKey);
logger.info("[WorkflowInstance-{}][TaskInstanceKey-{}:{}] Added task instance into retry check list",
processInstance.getId(), taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion());
}
public void removeTask4RetryCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
taskInstanceRetryCheckList.remove(taskInstanceKey);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
logger.info("remove task instance from retry check list");
}
public void addTask4StateCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
logger.info("Adding task instance into state check list");
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
if (taskInstanceStateCheckList.contains(taskInstanceKey)) {
logger.warn("Task instance is already in state check list");
return;
}
if (taskInstance.isDependTask() || taskInstance.isSubProcess()) {
taskInstanceStateCheckList.add(taskInstanceKey);
logger.info("Added task instance into state check list");
}
}
public void removeTask4StateCheck(@NonNull ProcessInstance processInstance, @NonNull TaskInstance taskInstance) {
TaskInstanceKey taskInstanceKey = TaskInstanceKey.getTaskInstanceKey(processInstance, taskInstance);
taskInstanceStateCheckList.remove(taskInstanceKey);
logger.info("Removed task instance from state check list");
}
public void clearAllTasks() {
processInstanceTimeoutCheckList.clear();
taskInstanceTimeoutCheckList.clear();
taskInstanceRetryCheckList.clear();
taskInstanceStateCheckList.clear();
}
private void checkTask4Timeout() {
if (taskInstanceTimeoutCheckList.isEmpty()) {
return;
}
for (TaskInstanceKey taskInstanceKey : taskInstanceTimeoutCheckList) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
try {
int processInstanceId = taskInstanceKey.getProcessInstanceId();
LoggerUtils.setWorkflowInstanceIdMDC(processInstanceId);
long taskCode = taskInstanceKey.getTaskCode();
WorkflowExecuteRunnable workflowExecuteThread =
processInstanceExecCacheManager.getByProcessInstanceId(processInstanceId);
if (workflowExecuteThread == null) {
logger.warn(
"Check task instance timeout failed, can not find workflowExecuteThread from cache manager, will remove this check task");
taskInstanceTimeoutCheckList.remove(taskInstanceKey);
continue;
}
Optional<TaskInstance> taskInstanceOptional =
workflowExecuteThread.getActiveTaskInstanceByTaskCode(taskCode);
if (!taskInstanceOptional.isPresent()) {
logger.warn(
"Check task instance timeout failed, can not get taskInstance from workflowExecuteThread, taskCode: {}"
+ "will remove this check task",
taskCode);
taskInstanceTimeoutCheckList.remove(taskInstanceKey);
continue;
}
TaskInstance taskInstance = taskInstanceOptional.get();
if (TimeoutFlag.OPEN == taskInstance.getTaskDefine().getTimeoutFlag()) {
long timeRemain = DateUtils.getRemainTime(taskInstance.getStartTime(),
(long) taskInstance.getTaskDefine().getTimeout()
* Constants.SEC_2_MINUTES_TIME_UNIT);
if (timeRemain < 0) {
logger.info("Task instance is timeout, adding task timeout event and remove the check");
addTaskTimeoutEvent(taskInstance);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
taskInstanceTimeoutCheckList.remove(taskInstanceKey);
}
}
} catch (Exception ex) {
logger.error("Check task timeout error, taskInstanceKey: {}", taskInstanceKey, ex);
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
}
}
}
private void checkTask4Retry() {
if (taskInstanceRetryCheckList.isEmpty()) {
return;
}
for (TaskInstanceKey taskInstanceKey : taskInstanceRetryCheckList) {
int processInstanceId = taskInstanceKey.getProcessInstanceId();
long taskCode = taskInstanceKey.getTaskCode();
try {
LoggerUtils.setWorkflowInstanceIdMDC(processInstanceId);
WorkflowExecuteRunnable workflowExecuteThread =
processInstanceExecCacheManager.getByProcessInstanceId(processInstanceId);
if (workflowExecuteThread == null) {
logger.warn(
"Task instance retry check failed, can not find workflowExecuteThread from cache manager, "
+ "will remove this check task");
taskInstanceRetryCheckList.remove(taskInstanceKey);
continue;
}
Optional<TaskInstance> taskInstanceOptional =
workflowExecuteThread.getRetryTaskInstanceByTaskCode(taskCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
ProcessInstance processInstance = workflowExecuteThread.getProcessInstance();
if (processInstance.getState().isReadyStop()) {
logger.warn(
"The process instance is ready to stop, will send process stop event and remove the check task");
addProcessStopEvent(processInstance);
taskInstanceRetryCheckList.remove(taskInstanceKey);
break;
}
if (!taskInstanceOptional.isPresent()) {
logger.warn(
"Task instance retry check failed, can not find taskInstance from workflowExecuteThread, will remove this check");
taskInstanceRetryCheckList.remove(taskInstanceKey);
continue;
}
TaskInstance taskInstance = taskInstanceOptional.get();
if (taskInstance.getState() != TaskExecutionStatus.NEED_FAULT_TOLERANCE
&& taskInstance.retryTaskIntervalOverTime()) {
logger.info("[TaskInstanceKey-{}:{}]The task instance can retry, will retry this task instance",
taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion());
taskInstance.setEndTime(null);
taskInstance.setState(TaskExecutionStatus.SUBMITTED_SUCCESS);
addTaskRetryEvent(taskInstance);
taskInstanceRetryCheckList.remove(taskInstanceKey);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
} catch (Exception ex) {
logger.error("Check task retry error, taskInstanceKey: {}", taskInstanceKey, ex);
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
}
}
}
private void checkTask4State() {
if (taskInstanceStateCheckList.isEmpty()) {
return;
}
for (TaskInstanceKey taskInstanceKey : taskInstanceStateCheckList) {
int processInstanceId = taskInstanceKey.getProcessInstanceId();
long taskCode = taskInstanceKey.getTaskCode();
try {
LoggerUtils.setTaskInstanceIdMDC(processInstanceId);
WorkflowExecuteRunnable workflowExecuteThread =
processInstanceExecCacheManager.getByProcessInstanceId(processInstanceId);
if (workflowExecuteThread == null) {
logger.warn(
"Task instance state check failed, can not find workflowExecuteThread from cache manager, will remove this check task");
taskInstanceStateCheckList.remove(taskInstanceKey);
continue;
}
Optional<TaskInstance> taskInstanceOptional =
workflowExecuteThread.getActiveTaskInstanceByTaskCode(taskCode);
if (!taskInstanceOptional.isPresent()) {
logger.warn(
"Task instance state check failed, can not find taskInstance from workflowExecuteThread, will remove this check event");
taskInstanceStateCheckList.remove(taskInstanceKey);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
continue;
}
TaskInstance taskInstance = taskInstanceOptional.get();
if (taskInstance.getState().isFinished()) {
continue;
}
addTaskStateChangeEvent(taskInstance);
} catch (Exception ex) {
logger.error("Task state check error, taskInstanceKey: {}", taskInstanceKey, ex);
} finally {
LoggerUtils.removeWorkflowInstanceIdMDC();
}
}
}
private void addTaskStateChangeEvent(TaskInstance taskInstance) {
TaskStateEvent stateEvent = TaskStateEvent.builder()
.processInstanceId(taskInstance.getProcessInstanceId())
.taskInstanceId(taskInstance.getId())
.taskCode(taskInstance.getTaskCode())
.type(StateEventType.TASK_STATE_CHANGE)
.status(TaskExecutionStatus.RUNNING_EXECUTION)
.build();
workflowExecuteThreadPool.submitStateEvent(stateEvent);
}
private void addProcessStopEvent(ProcessInstance processInstance) {
WorkflowStateEvent stateEvent = WorkflowStateEvent.builder()
.processInstanceId(processInstance.getId())
.type(StateEventType.PROCESS_STATE_CHANGE)
.status(WorkflowExecutionStatus.STOP)
.build();
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,043 |
[Bug] [task retry] Clone retry task Instance missing id field
|
### 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
In WorkflowExecuteRunnable. NewTaskInstance (), lack of the set id field.
task retry causes the NPE to occur.
NPE location: StateWheelExecuteThread. addTaskRetryEvent() set taskInstanceId
### What you expected to happen
The task instance can retry properly
### How to reproduce
task set retry
### Anything else
_No response_
### Version
3.1.x
### 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/13043
|
https://github.com/apache/dolphinscheduler/pull/13077
|
fed1e85fb833bf5dec9de36b5a539885c2da1ee3
|
a7ecc5a8b31d63bb71615d59aeffddc60e59f5aa
| 2022-11-29T08:48:45Z |
java
| 2022-12-05T13:22:51Z |
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
|
workflowExecuteThreadPool.submitStateEvent(stateEvent);
}
private void addTaskRetryEvent(TaskInstance taskInstance) {
TaskStateEvent stateEvent = TaskStateEvent.builder()
.processInstanceId(taskInstance.getProcessInstanceId())
.taskInstanceId(taskInstance.getId())
.taskCode(taskInstance.getTaskCode())
.status(TaskExecutionStatus.RUNNING_EXECUTION)
.type(StateEventType.TASK_RETRY)
.build();
workflowExecuteThreadPool.submitStateEvent(stateEvent);
}
private void addTaskTimeoutEvent(TaskInstance taskInstance) {
TaskStateEvent stateEvent = TaskStateEvent.builder()
.processInstanceId(taskInstance.getProcessInstanceId())
.taskInstanceId(taskInstance.getId())
.type(StateEventType.TASK_TIMEOUT)
.taskCode(taskInstance.getTaskCode())
.build();
workflowExecuteThreadPool.submitStateEvent(stateEvent);
}
private void addProcessTimeoutEvent(ProcessInstance processInstance) {
WorkflowStateEvent stateEvent = WorkflowStateEvent.builder()
.processInstanceId(processInstance.getId())
.type(StateEventType.PROCESS_TIMEOUT)
.build();
workflowExecuteThreadPool.submitStateEvent(stateEvent);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.