status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
conditionTaskList = conditionsParameters.getFailedNode(); skipNodeList = conditionsParameters.getSuccessNode(); } else { conditionTaskList.add(nodeCode); } for (String failedNode : skipNodeList) { setTaskNodeSkip(failedNode, dag, completeTaskList, skipTaskNodeList); } return conditionTaskList; } /** * parse condition task find the branch process * set skip flag for another one. * * @param nodeCode * @return */ public static List<String> parseSwitchTask(String nodeCode, Map<String, TaskNode> skipTaskNodeList, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList) { List<String> conditionTaskList = new ArrayList<>(); TaskNode taskNode = dag.getNode(nodeCode); if (!taskNode.isSwitchTask()) { return conditionTaskList; } if (!completeTaskList.containsKey(nodeCode)) { return conditionTaskList; } conditionTaskList = skipTaskNode4Switch(taskNode, skipTaskNodeList, completeTaskList, dag);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
return conditionTaskList; } private static List<String> skipTaskNode4Switch(TaskNode taskNode, Map<String, TaskNode> skipTaskNodeList, Map<String, TaskInstance> completeTaskList, DAG<String, TaskNode, TaskNodeRelation> dag) { SwitchParameters switchParameters = completeTaskList.get(taskNode.getName()).getSwitchDependency(); int resultConditionLocation = switchParameters.getResultConditionLocation(); List<SwitchResultVo> conditionResultVoList = switchParameters.getDependTaskList(); List<String> switchTaskList = conditionResultVoList.get(resultConditionLocation).getNextNode(); if (CollectionUtils.isEmpty(switchTaskList)) { switchTaskList = new ArrayList<>(); } conditionResultVoList.remove(resultConditionLocation); for (SwitchResultVo info : conditionResultVoList) { if (CollectionUtils.isEmpty(info.getNextNode())) { continue; } setTaskNodeSkip(info.getNextNode().get(0), dag, completeTaskList, skipTaskNodeList); } return switchTaskList; } /** * set task node and the post nodes skip flag */ private static void setTaskNodeSkip(String skipNodeCode, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList, Map<String, TaskNode> skipTaskNodeList) { if (!dag.containsNode(skipNodeCode)) { return;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
} skipTaskNodeList.putIfAbsent(skipNodeCode, dag.getNode(skipNodeCode)); Collection<String> postNodeList = dag.getSubsequentNodes(skipNodeCode); for (String post : postNodeList) { TaskNode postNode = dag.getNode(post); if (isTaskNodeNeedSkip(postNode, skipTaskNodeList)) { setTaskNodeSkip(post, dag, completeTaskList, skipTaskNodeList); } } } /*** * build dag graph * @param processDag processDag * @return dag */ public static DAG<String, TaskNode, TaskNodeRelation> buildDagGraph(ProcessDag processDag) { DAG<String, TaskNode, TaskNodeRelation> dag = new DAG<>(); if (CollectionUtils.isNotEmpty(processDag.getNodes())) { for (TaskNode node : processDag.getNodes()) { dag.addNode(Long.toString(node.getCode()), node); } } if (CollectionUtils.isNotEmpty(processDag.getEdges())) { for (TaskNodeRelation edge : processDag.getEdges()) { dag.addEdge(edge.getStartNode(), edge.getEndNode()); } } return dag;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
} /** * get process dag * * @param taskNodeList task node list * @return Process dag */ public static ProcessDag getProcessDag(List<TaskNode> taskNodeList) { List<TaskNodeRelation> taskNodeRelations = new ArrayList<>(); for (TaskNode taskNode : taskNodeList) { String preTasks = taskNode.getPreTasks(); List<String> preTasksList = JSONUtils.toList(preTasks, String.class); if (preTasksList != null) { for (String depNode : preTasksList) { taskNodeRelations.add(new TaskNodeRelation(depNode, Long.toString(taskNode.getCode()))); } } } ProcessDag processDag = new ProcessDag(); processDag.setEdges(taskNodeRelations); processDag.setNodes(taskNodeList); return processDag; } /** * get process dag * * @param taskNodeList task node list * @return Process dag
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
*/ public static ProcessDag getProcessDag(List<TaskNode> taskNodeList, List<ProcessTaskRelation> processTaskRelations) { Map<Long, TaskNode> taskNodeMap = new HashMap<>(); taskNodeList.forEach(taskNode -> { taskNodeMap.putIfAbsent(taskNode.getCode(), taskNode); }); List<TaskNodeRelation> taskNodeRelations = new ArrayList<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { long preTaskCode = processTaskRelation.getPreTaskCode(); long postTaskCode = processTaskRelation.getPostTaskCode(); if (processTaskRelation.getPreTaskCode() != 0 && taskNodeMap.containsKey(preTaskCode) && taskNodeMap.containsKey(postTaskCode)) { TaskNode preNode = taskNodeMap.get(preTaskCode); TaskNode postNode = taskNodeMap.get(postTaskCode); taskNodeRelations.add(new TaskNodeRelation(Long.toString(preNode.getCode()), Long.toString(postNode.getCode()))); } } ProcessDag processDag = new ProcessDag(); processDag.setEdges(taskNodeRelations); processDag.setNodes(taskNodeList); return processDag; } /** * is there have conditions after the parent node */ public static boolean haveConditionsAfterNode(String parentNodeCode, DAG<String, TaskNode, TaskNodeRelation> dag ) { boolean result = false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
Set<String> subsequentNodes = dag.getSubsequentNodes(parentNodeCode); if (CollectionUtils.isEmpty(subsequentNodes)) { return result; } for (String nodeCode : subsequentNodes) { TaskNode taskNode = dag.getNode(nodeCode); List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class); if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) { return true; } } return result; } /** * is there have conditions after the parent node */ public static boolean haveConditionsAfterNode(String parentNodeCode, List<TaskNode> taskNodes) { if (CollectionUtils.isEmpty(taskNodes)) { return false; } for (TaskNode taskNode : taskNodes) { List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class); if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) { return true; } } return false; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.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
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
package org.apache.dolphinscheduler.server.master.runner.task; import org.apache.dolphinscheduler.common.enums.DependResult; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters; import org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.NetUtils; 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.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.utils.LogUtils; import org.apache.dolphinscheduler.server.utils.SwitchTaskUtils; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.commons.lang.StringUtils; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; public class SwitchTaskProcessor extends BaseTaskProcessor { protected final String rgex = "['\"]*\\$\\{(.*?)\\}['\"]*"; private TaskInstance taskInstance; private ProcessInstance processInstance; TaskDefinition taskDefinition; MasterConfig masterConfig = SpringApplicationContext.getBean(MasterConfig.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
/** * switch result */ private DependResult conditionResult; @Override public boolean submit(TaskInstance taskInstance, ProcessInstance processInstance, int masterTaskCommitRetryTimes, int masterTaskCommitInterval) { this.processInstance = processInstance; this.taskInstance = processService.submitTaskWithRetry(processInstance, taskInstance, masterTaskCommitRetryTimes, masterTaskCommitInterval); if (this.taskInstance == null) { return false; } taskDefinition = processService.findTaskDefinition( taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion() ); taskInstance.setLogPath(LogUtils.getTaskLogPath(taskInstance.getFirstSubmitTime(),processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion(), taskInstance.getProcessInstanceId(), taskInstance.getId())); taskInstance.setHost(NetUtils.getAddr(masterConfig.getListenPort())); taskInstance.setState(ExecutionStatus.RUNNING_EXECUTION); taskInstance.setStartTime(new Date()); processService.updateTaskInstance(taskInstance); return true; } @Override public void run() { try { if (!this.taskState().typeIsFinished() && setSwitchResult()) { endTaskState(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
} catch (Exception e) { logger.error("update work flow {} switch task {} state error:", this.processInstance.getId(), this.taskInstance.getId(), e); } } @Override protected boolean pauseTask() { this.taskInstance.setState(ExecutionStatus.PAUSE); this.taskInstance.setEndTime(new Date()); processService.saveTaskInstance(taskInstance); return true; } @Override protected boolean killTask() { this.taskInstance.setState(ExecutionStatus.KILL); this.taskInstance.setEndTime(new Date()); processService.saveTaskInstance(taskInstance); return true; } @Override protected boolean taskTimeout() { return true; } @Override public String getType() { return TaskType.SWITCH.getDesc(); } @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
public ExecutionStatus taskState() { return this.taskInstance.getState(); } private boolean setSwitchResult() { List<TaskInstance> taskInstances = processService.findValidTaskListByProcessId( taskInstance.getProcessInstanceId() ); Map<String, ExecutionStatus> completeTaskList = new HashMap<>(); for (TaskInstance task : taskInstances) { completeTaskList.putIfAbsent(task.getName(), task.getState()); } SwitchParameters switchParameters = taskInstance.getSwitchDependency(); List<SwitchResultVo> switchResultVos = switchParameters.getDependTaskList(); SwitchResultVo switchResultVo = new SwitchResultVo(); switchResultVo.setNextNode(switchParameters.getNextNode()); switchResultVos.add(switchResultVo); int finalConditionLocation = switchResultVos.size() - 1; int i = 0; conditionResult = DependResult.SUCCESS; for (SwitchResultVo info : switchResultVos) { logger.info("the {} execution ", (i + 1)); logger.info("original condition sentence:{}", info.getCondition()); if (StringUtils.isEmpty(info.getCondition())) { finalConditionLocation = i; break; } String content = setTaskParams(info.getCondition().replaceAll("'", "\""), rgex); logger.info("format condition sentence::{}", content); Boolean result = null; try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
result = SwitchTaskUtils.evaluate(content); } catch (Exception e) { logger.info("error sentence : {}", content); conditionResult = DependResult.FAILED; break; } logger.info("condition result : {}", result); if (result) { finalConditionLocation = i; break; } i++; } switchParameters.setDependTaskList(switchResultVos); switchParameters.setResultConditionLocation(finalConditionLocation); taskInstance.setSwitchDependency(switchParameters); logger.info("the switch task depend result : {}", conditionResult); return true; } /** * update task state */ private void endTaskState() { ExecutionStatus status = (conditionResult == DependResult.SUCCESS) ? ExecutionStatus.SUCCESS : ExecutionStatus.FAILURE; taskInstance.setEndTime(new Date()); taskInstance.setState(status); processService.updateTaskInstance(taskInstance); } public String setTaskParams(String content, String rgex) { Pattern pattern = Pattern.compile(rgex);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,019
[Bug] [MasterServer] switch task run error
### 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 branch: 2.0 ``` [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception! com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611) at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182) at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127) at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141) ... 30 common frames omitted [ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139) at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` it seems like the task params was dismatch between ui and server, which cause conversion failure. ### What you expected to happen switch task run normally. ### How to reproduce create a switch task and run it. ### Anything else _No response_ ### Version 2.0.0 ### 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/7019
https://github.com/apache/dolphinscheduler/pull/7046
8e93939121043b828f73ea2898c6102aa858524b
a0955a078a2ca83f3736caf5f05a325545168114
"2021-11-26T13:44:05Z"
java
"2021-11-30T01:59:48Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java
Matcher m = pattern.matcher(content); Map<String, Property> globalParams = JSONUtils .toList(processInstance.getGlobalParams(), Property.class) .stream() .collect(Collectors.toMap(Property::getProp, Property -> Property)); Map<String, Property> varParams = JSONUtils .toList(taskInstance.getVarPool(), Property.class) .stream() .collect(Collectors.toMap(Property::getProp, Property -> Property)); if (varParams.size() > 0) { varParams.putAll(globalParams); globalParams = varParams; } while (m.find()) { String paramName = m.group(1); Property property = globalParams.get(paramName); if (property == null) { return ""; } String value = property.getValue(); if (!org.apache.commons.lang.math.NumberUtils.isNumber(value)) { value = "\"" + value + "\""; } logger.info("paramName:{},paramValue{}", paramName, value); content = content.replace("${" + paramName + "}", value); } return content; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,955
[Bug] [UI] View task status module on project homepage cannot read property'label' of undefined
### 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 View task status module on project homepage cannot read property'label' of undefined ``` TypeError: Cannot read property 'label' of undefined at eval (taskStatusCount.vue?cc37:86) at arrayMap (lodash.js?2ef0:653) at Function.map (lodash.js?2ef0:9622) at VueComponent._handleTaskStatus (taskStatusCount.vue?cc37:86) at eval (taskStatusCount.vue?cc37:113) ``` ### What you expected to happen The page is displayed normally ### How to reproduce Project homepage view exception ### 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/6955
https://github.com/apache/dolphinscheduler/pull/6956
631a31b6ac6068100f312d7194a6939bc7801bf8
f0630bc9a05cf4e4407e040ad0bec36d486aa173
"2021-11-22T05:04:52Z"
java
"2021-11-30T02:00:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.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.common.enums; import java.util.HashMap; import com.baomidou.mybatisplus.annotation.EnumValue; /** * running status for workflow and task nodes */ public enum ExecutionStatus { /** * status: * 0 submit success * 1 running
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,955
[Bug] [UI] View task status module on project homepage cannot read property'label' of undefined
### 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 View task status module on project homepage cannot read property'label' of undefined ``` TypeError: Cannot read property 'label' of undefined at eval (taskStatusCount.vue?cc37:86) at arrayMap (lodash.js?2ef0:653) at Function.map (lodash.js?2ef0:9622) at VueComponent._handleTaskStatus (taskStatusCount.vue?cc37:86) at eval (taskStatusCount.vue?cc37:113) ``` ### What you expected to happen The page is displayed normally ### How to reproduce Project homepage view exception ### 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/6955
https://github.com/apache/dolphinscheduler/pull/6956
631a31b6ac6068100f312d7194a6939bc7801bf8
f0630bc9a05cf4e4407e040ad0bec36d486aa173
"2021-11-22T05:04:52Z"
java
"2021-11-30T02:00:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
* 2 ready pause * 3 pause * 4 ready stop * 5 stop * 6 failure * 7 success * 8 need fault tolerance * 9 kill * 10 waiting thread * 11 waiting depend node complete * 12 delay execution * 13 forced success */ SUBMITTED_SUCCESS(0, "submit success"), RUNNING_EXECUTION(1, "running"), READY_PAUSE(2, "ready pause"), PAUSE(3, "pause"), READY_STOP(4, "ready stop"), STOP(5, "stop"), FAILURE(6, "failure"), SUCCESS(7, "success"), NEED_FAULT_TOLERANCE(8, "need fault tolerance"), KILL(9, "kill"), WAITING_THREAD(10, "waiting thread"), WAITING_DEPEND(11, "waiting depend node complete"), DELAY_EXECUTION(12, "delay execution"), FORCED_SUCCESS(13, "forced success"), SERIAL_WAIT(14, "serial wait"); ExecutionStatus(int code, String descp) { this.code = code;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,955
[Bug] [UI] View task status module on project homepage cannot read property'label' of undefined
### 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 View task status module on project homepage cannot read property'label' of undefined ``` TypeError: Cannot read property 'label' of undefined at eval (taskStatusCount.vue?cc37:86) at arrayMap (lodash.js?2ef0:653) at Function.map (lodash.js?2ef0:9622) at VueComponent._handleTaskStatus (taskStatusCount.vue?cc37:86) at eval (taskStatusCount.vue?cc37:113) ``` ### What you expected to happen The page is displayed normally ### How to reproduce Project homepage view exception ### 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/6955
https://github.com/apache/dolphinscheduler/pull/6956
631a31b6ac6068100f312d7194a6939bc7801bf8
f0630bc9a05cf4e4407e040ad0bec36d486aa173
"2021-11-22T05:04:52Z"
java
"2021-11-30T02:00:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
this.descp = descp; } @EnumValue private final int code; private final String descp; private static HashMap<Integer, ExecutionStatus> EXECUTION_STATUS_MAP = new HashMap<>(); static { for (ExecutionStatus executionStatus : ExecutionStatus.values()) { EXECUTION_STATUS_MAP.put(executionStatus.code, executionStatus); } } /** * status is success * * @return status */ public boolean typeIsSuccess() { return this == SUCCESS || this == FORCED_SUCCESS; } /** * status is failure * * @return status */ public boolean typeIsFailure() { return this == FAILURE || this == NEED_FAULT_TOLERANCE; } /** * status is finished *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,955
[Bug] [UI] View task status module on project homepage cannot read property'label' of undefined
### 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 View task status module on project homepage cannot read property'label' of undefined ``` TypeError: Cannot read property 'label' of undefined at eval (taskStatusCount.vue?cc37:86) at arrayMap (lodash.js?2ef0:653) at Function.map (lodash.js?2ef0:9622) at VueComponent._handleTaskStatus (taskStatusCount.vue?cc37:86) at eval (taskStatusCount.vue?cc37:113) ``` ### What you expected to happen The page is displayed normally ### How to reproduce Project homepage view exception ### 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/6955
https://github.com/apache/dolphinscheduler/pull/6956
631a31b6ac6068100f312d7194a6939bc7801bf8
f0630bc9a05cf4e4407e040ad0bec36d486aa173
"2021-11-22T05:04:52Z"
java
"2021-11-30T02:00:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
* @return status */ public boolean typeIsFinished() { return typeIsSuccess() || typeIsFailure() || typeIsCancel() || typeIsPause() || typeIsStop(); } /** * status is waiting thread * * @return status */ public boolean typeIsWaitingThread() { return this == WAITING_THREAD; } /** * status is pause * * @return status */ public boolean typeIsPause() { return this == PAUSE; } /** * status is pause * * @return status */ public boolean typeIsStop() { return this == STOP; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,955
[Bug] [UI] View task status module on project homepage cannot read property'label' of undefined
### 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 View task status module on project homepage cannot read property'label' of undefined ``` TypeError: Cannot read property 'label' of undefined at eval (taskStatusCount.vue?cc37:86) at arrayMap (lodash.js?2ef0:653) at Function.map (lodash.js?2ef0:9622) at VueComponent._handleTaskStatus (taskStatusCount.vue?cc37:86) at eval (taskStatusCount.vue?cc37:113) ``` ### What you expected to happen The page is displayed normally ### How to reproduce Project homepage view exception ### 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/6955
https://github.com/apache/dolphinscheduler/pull/6956
631a31b6ac6068100f312d7194a6939bc7801bf8
f0630bc9a05cf4e4407e040ad0bec36d486aa173
"2021-11-22T05:04:52Z"
java
"2021-11-30T02:00:54Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
/** * status is running * * @return status */ public boolean typeIsRunning() { return this == RUNNING_EXECUTION || this == WAITING_DEPEND || this == DELAY_EXECUTION; } /** * status is cancel * * @return status */ public boolean typeIsCancel() { return this == KILL || this == STOP; } public int getCode() { return code; } public String getDescp() { return descp; } public static ExecutionStatus of(int status) { if (EXECUTION_STATUS_MAP.containsKey(status)) { return EXECUTION_STATUS_MAP.get(status); } throw new IllegalArgumentException("invalid status : " + status); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.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.registry; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_NODE; import static org.apache.dolphinscheduler.common.Constants.SLEEP_TIME_MILLIS; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.IStoppable; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.enums.StateEvent; import org.apache.dolphinscheduler.common.enums.StateEventType; import org.apache.dolphinscheduler.common.model.Server; import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.registry.api.ConnectionState; import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory; import org.apache.dolphinscheduler.server.builder.TaskExecutionContextBuilder; import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread; import org.apache.dolphinscheduler.server.registry.HeartBeatTask; import org.apache.dolphinscheduler.server.utils.ProcessUtils; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext; import org.apache.dolphinscheduler.service.registry.RegistryClient; import org.apache.commons.lang.StringUtils; import java.util.Collections; import java.util.Date; import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.google.common.collect.Sets; /** * zookeeper master client * <p> * single instance */ @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
public class MasterRegistryClient { /** * logger */ private static final Logger logger = LoggerFactory.getLogger(MasterRegistryClient.class); /** * process service */ @Autowired private ProcessService processService; @Autowired private RegistryClient registryClient; /** * master config */ @Autowired private MasterConfig masterConfig; /** * heartbeat executor */ private ScheduledExecutorService heartBeatExecutor; @Autowired private ProcessInstanceExecCacheManager processInstanceExecCacheManager; /** * master startup time, ms */ private long startupTime; private String localNodePath;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
public void init() { this.startupTime = System.currentTimeMillis(); this.heartBeatExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("HeartBeatExecutor")); } public void start() { String nodeLock = Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS; try { registryClient.getLock(nodeLock); registry(); String registryPath = getMasterPath(); registryClient.handleDeadServer(Collections.singleton(registryPath), NodeType.MASTER, Constants.DELETE_OP); while (!registryClient.checkNodeExists(NetUtils.getHost(), NodeType.MASTER)) { ThreadUtils.sleep(SLEEP_TIME_MILLIS); } if (registryClient.getActiveMasterNum() == 1) { removeNodePath(null, NodeType.MASTER, true); removeNodePath(null, NodeType.WORKER, true); } registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_NODE, new MasterRegistryDataListener()); } catch (Exception e) { logger.error("master start up exception", e); } finally { registryClient.releaseLock(nodeLock); } } public void setRegistryStoppable(IStoppable stoppable) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
registryClient.setStoppable(stoppable); } public void closeRegistry() { deregister(); } /** * remove zookeeper node path * * @param path zookeeper node path * @param nodeType zookeeper node type * @param failover is failover */ public void removeNodePath(String path, NodeType nodeType, boolean failover) { logger.info("{} node deleted : {}", nodeType, path); String failoverPath = getFailoverLockPath(nodeType); try { registryClient.getLock(failoverPath); String serverHost = null; if (!StringUtils.isEmpty(path)) { serverHost = registryClient.getHostByEventDataPath(path); if (StringUtils.isEmpty(serverHost)) { logger.error("server down error: unknown path: {}", path); return; } registryClient.handleDeadServer(Collections.singleton(path), nodeType, Constants.ADD_OP); } if (failover) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
failoverServerWhenDown(serverHost, nodeType); } } catch (Exception e) { logger.error("{} server failover failed.", nodeType); logger.error("failover exception ", e); } finally { registryClient.releaseLock(failoverPath); } } /** * failover server when server down * * @param serverHost server host * @param nodeType zookeeper node type */ private void failoverServerWhenDown(String serverHost, NodeType nodeType) { switch (nodeType) { case MASTER: failoverMaster(serverHost); break; case WORKER: failoverWorker(serverHost, true, true); break; default: break; } } /** * get failover lock path *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
* @param nodeType zookeeper node type * @return fail over lock path */ private String getFailoverLockPath(NodeType nodeType) { switch (nodeType) { case MASTER: return Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS; case WORKER: return Constants.REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS; default: return ""; } } /** * task needs failover if task start before worker starts * * @param taskInstance task instance * @return true if task instance need fail over */ private boolean checkTaskInstanceNeedFailover(TaskInstance taskInstance) { boolean taskNeedFailover = true; if (taskInstance.getHost() == null) { return false; } if (registryClient.checkNodeExists(taskInstance.getHost(), NodeType.WORKER)) { if (checkTaskAfterWorkerStart(taskInstance)) { taskNeedFailover = false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
} } return taskNeedFailover; } /** * check task start after the worker server starts. * * @param taskInstance task instance * @return true if task instance start time after worker server start date */ private boolean checkTaskAfterWorkerStart(TaskInstance taskInstance) { if (StringUtils.isEmpty(taskInstance.getHost())) { return false; } Date workerServerStartDate = null; List<Server> workerServers = registryClient.getServerList(NodeType.WORKER); for (Server workerServer : workerServers) { if (taskInstance.getHost().equals(workerServer.getHost() + Constants.COLON + workerServer.getPort())) { workerServerStartDate = workerServer.getCreateTime(); break; } } if (workerServerStartDate != null) { return taskInstance.getStartTime().after(workerServerStartDate); } return false; } /** * failover worker tasks * <p>
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
* 1. kill yarn job if there are yarn jobs in tasks. * 2. change task state from running to need failover. * 3. failover all tasks when workerHost is null * * @param workerHost worker host * @param needCheckWorkerAlive need check worker alive * @param checkOwner need check process instance owner */ private void failoverWorker(String workerHost, boolean needCheckWorkerAlive, boolean checkOwner) { logger.info("start worker[{}] failover ...", workerHost); List<TaskInstance> needFailoverTaskInstanceList = processService.queryNeedFailoverTaskInstances(workerHost); for (TaskInstance taskInstance : needFailoverTaskInstanceList) { if (needCheckWorkerAlive) { if (!checkTaskInstanceNeedFailover(taskInstance)) { continue; } } ProcessInstance processInstance = processService.findProcessInstanceDetailById(taskInstance.getProcessInstanceId()); if (workerHost == null || !checkOwner || processInstance.getHost().equalsIgnoreCase(getLocalAddress())) { if (processInstance == null) { logger.error("failover error, the process {} of task {} do not exists.", taskInstance.getProcessInstanceId(), taskInstance.getId()); continue; } taskInstance.setProcessInstance(processInstance); TaskExecutionContext taskExecutionContext = TaskExecutionContextBuilder.get() .buildTaskInstanceRelatedInfo(taskInstance)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
.buildProcessInstanceRelatedInfo(processInstance) .create(); ProcessUtils.killYarnJob(taskExecutionContext); taskInstance.setState(ExecutionStatus.NEED_FAULT_TOLERANCE); processService.saveTaskInstance(taskInstance); if (!processInstanceExecCacheManager.contains(processInstance.getId())) { continue; } WorkflowExecuteThread workflowExecuteThreadNotify = processInstanceExecCacheManager.getByProcessInstanceId(processInstance.getId()); StateEvent stateEvent = new StateEvent(); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setType(StateEventType.TASK_STATE_CHANGE); stateEvent.setProcessInstanceId(processInstance.getId()); stateEvent.setExecutionStatus(taskInstance.getState()); workflowExecuteThreadNotify.addStateEvent(stateEvent); } } logger.info("end worker[{}] failover ...", workerHost); } /** * failover master tasks * * @param masterHost master host */ private void failoverMaster(String masterHost) { logger.info("start master failover ..."); List<ProcessInstance> needFailoverProcessInstanceList = processService.queryNeedFailoverProcessInstances(masterHost); logger.info("failover process list size:{} ", needFailoverProcessInstanceList.size());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
for (ProcessInstance processInstance : needFailoverProcessInstanceList) { logger.info("failover process instance id: {} host:{}", processInstance.getId(), processInstance.getHost()); if (Constants.NULL.equals(processInstance.getHost())) { continue; } processService.processNeedFailoverProcessInstances(processInstance); } failoverWorker(masterHost, true, false); logger.info("master failover end"); } /** * registry */ public void registry() { String address = NetUtils.getAddr(masterConfig.getListenPort()); localNodePath = getMasterPath(); int masterHeartbeatInterval = masterConfig.getHeartbeatInterval(); HeartBeatTask heartBeatTask = new HeartBeatTask(startupTime, masterConfig.getMaxCpuLoadAvg(), masterConfig.getReservedMemory(), Sets.newHashSet(getMasterPath()), Constants.MASTER_TYPE, registryClient); registryClient.persistEphemeral(localNodePath, heartBeatTask.getHeartBeatInfo()); registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); this.heartBeatExecutor.scheduleAtFixedRate(heartBeatTask, masterHeartbeatInterval, masterHeartbeatInterval, TimeUnit.SECONDS);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
logger.info("master node : {} registry to ZK successfully with heartBeatInterval : {}s", address, masterHeartbeatInterval); } public void deregister() { try { String address = getLocalAddress(); String localNodePath = getMasterPath(); registryClient.remove(localNodePath); logger.info("master node : {} unRegistry to register center.", address); heartBeatExecutor.shutdown(); logger.info("heartbeat executor shutdown"); registryClient.close(); } catch (Exception e) { logger.error("remove registry path exception ", e); } } /** * get master path */ public String getMasterPath() { String address = getLocalAddress(); return REGISTRY_DOLPHINSCHEDULER_MASTERS + "/" + address; } /** * get local address */ private String getLocalAddress() { return NetUtils.getAddr(masterConfig.getListenPort()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClientTest.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
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClientTest.java
*/ package org.apache.dolphinscheduler.server.master.registry; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.doNothing; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.model.Server; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.server.master.cache.impl.ProcessInstanceExecCacheManagerImpl; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.dolphinscheduler.service.registry.RegistryClient; import java.util.Arrays; import java.util.Date; import java.util.concurrent.ScheduledExecutorService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.springframework.test.util.ReflectionTestUtils; /** * MasterRegistryClientTest */ @RunWith(PowerMockRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClientTest.java
@PrepareForTest({ RegistryClient.class }) @PowerMockIgnore({"javax.management.*"}) public class MasterRegistryClientTest { @InjectMocks private MasterRegistryClient masterRegistryClient; @Mock private MasterConfig masterConfig; @Mock private RegistryClient registryClient; @Mock private ScheduledExecutorService heartBeatExecutor; @Mock private ProcessService processService; @Mock private ProcessInstanceExecCacheManagerImpl processInstanceExecCacheManager; @Before public void before() throws Exception { given(registryClient.getLock(Mockito.anyString())).willReturn(true); given(registryClient.releaseLock(Mockito.anyString())).willReturn(true); given(registryClient.getHostByEventDataPath(Mockito.anyString())).willReturn("127.0.0.1:8080"); doNothing().when(registryClient).handleDeadServer(Mockito.anySet(), Mockito.any(NodeType.class), Mockito.anyString()); ReflectionTestUtils.setField(masterRegistryClient, "registryClient", registryClient); ProcessInstance processInstance = new ProcessInstance(); processInstance.setId(1); processInstance.setHost("127.0.0.1:8080");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,004
[Bug] [MasterServer] master will still work when it lose zk connection
### 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 Now when master lose zk connection, it will still find commands and handle processInstance, because the condition `ServerNodeManager.MASTER_SIZE` and `slot` is not changed. So it may happen two masters have the same slot, and I found `MasterRegistryClient` addConnectionStateListener when registry: `registryClient.addConnectionStateListener(newState -> { if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.SUSPENDED) { registryClient.persistEphemeral(localNodePath, ""); } }); ` ### What you expected to happen When master lose zk connection, stop processing command until reconnect. ### How to reproduce none ### Anything else _No response_ ### Version dev ### 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/7004
https://github.com/apache/dolphinscheduler/pull/7045
6e5539478392d6c1f334ae53d01574b5e54e769c
be3bd4c83d30773ce6204bca08d3cd1e6444dea9
"2021-11-26T02:54:02Z"
java
"2021-11-30T03:00:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClientTest.java
processInstance.setHistoryCmd("xxx"); processInstance.setCommandType(CommandType.STOP); given(processService.queryNeedFailoverProcessInstances(Mockito.anyString())).willReturn(Arrays.asList(processInstance)); doNothing().when(processService).processNeedFailoverProcessInstances(Mockito.any(ProcessInstance.class)); TaskInstance taskInstance = new TaskInstance(); taskInstance.setId(1); taskInstance.setStartTime(new Date()); taskInstance.setHost("127.0.0.1:8080"); given(processService.queryNeedFailoverTaskInstances(Mockito.anyString())).willReturn(Arrays.asList(taskInstance)); given(processService.findProcessInstanceDetailById(Mockito.anyInt())).willReturn(processInstance); given(registryClient.checkNodeExists(Mockito.anyString(), Mockito.any())).willReturn(true); Server server = new Server(); server.setHost("127.0.0.1"); server.setPort(8080); server.setCreateTime(new Date()); given(registryClient.getServerList(NodeType.WORKER)).willReturn(Arrays.asList(server)); } @Test public void registryTest() { masterRegistryClient.registry(); } @Test public void removeNodePathTest() { masterRegistryClient.removeNodePath("/path", NodeType.MASTER, false); masterRegistryClient.removeNodePath("/path", NodeType.MASTER, true); masterRegistryClient.removeNodePath("/path", NodeType.WORKER, true); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.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.alert; import static org.apache.dolphinscheduler.common.Constants.ALERT_RPC_PORT; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.dao.PluginDao; import org.apache.dolphinscheduler.dao.entity.Alert; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import java.io.Closeable; import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @EnableAutoConfiguration @ComponentScan(value = { "org.apache.dolphinscheduler.alert", "org.apache.dolphinscheduler.dao" }) public class AlertServer implements Closeable { private static final Logger log = LoggerFactory.getLogger(AlertServer.class); private final PluginDao pluginDao; private final AlertDao alertDao; private final AlertPluginManager alertPluginManager; private final AlertSender alertSender; private final AlertRequestProcessor alertRequestProcessor; private NettyRemotingServer server; public AlertServer(PluginDao pluginDao, AlertDao alertDao, AlertPluginManager alertPluginManager, AlertSender alertSender, AlertRequestProcessor alertRequestProcessor) { this.pluginDao = pluginDao; this.alertDao = alertDao; this.alertPluginManager = alertPluginManager; this.alertSender = alertSender; this.alertRequestProcessor = alertRequestProcessor; } public static void main(String[] args) { SpringApplication.run(AlertServer.class, args); } @PostConstruct
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
public void start() { log.info("Starting Alert server"); checkTable(); startServer(); if (alertPluginManager.size() == 0) { log.warn("No alert plugin, alert sender will exit."); return; } Executors.newScheduledThreadPool(1) .scheduleAtFixedRate(new Sender(), 5, 5, TimeUnit.SECONDS); } @Override @PreDestroy public void close() { server.close(); } private void checkTable() { if (!pluginDao.checkPluginDefineTableExist()) { log.error("Plugin Define Table t_ds_plugin_define Not Exist . Please Create it First !"); System.exit(1); } } private void startServer() { NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(ALERT_RPC_PORT); server = new NettyRemotingServer(serverConfig); server.registerProcessor(CommandType.ALERT_SEND_REQUEST, alertRequestProcessor); server.start(); } final class Sender implements Runnable {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
@Override public void run() { if (!Stopper.isRunning()) { return; } try { final List<Alert> alerts = alertDao.listPendingAlerts(); alertSender.send(alerts); } catch (Exception e) { log.error("Failed to send alert", e); } } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.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 *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java
* 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; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ServiceException; import org.apache.dolphinscheduler.api.service.LoggerService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.commons.lang.StringUtils; import java.nio.charset.StandardCharsets; import java.util.Objects; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.google.common.primitives.Bytes; /** * logger service impl */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java
public class LoggerServiceImpl implements LoggerService { private static final Logger logger = LoggerFactory.getLogger(LoggerServiceImpl.class); private static final String LOG_HEAD_FORMAT = "[LOG-PATH]: %s, [HOST]: %s%s"; @Autowired private ProcessService processService; private LogClientService logClient; @PostConstruct public void init() { if (Objects.isNull(this.logClient)) { this.logClient = new LogClientService(); } } @PreDestroy public void close() { if (Objects.nonNull(this.logClient) && this.logClient.isRunning()) { logClient.close(); } } /** * view log * * @param taskInstId task instance id * @param skipLineNum skip line number * @param limit limit
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java
* @return log string data */ @Override @SuppressWarnings("unchecked") public Result<String> queryLog(int taskInstId, int skipLineNum, int limit) { TaskInstance taskInstance = processService.findTaskInstanceById(taskInstId); if (taskInstance == null || StringUtils.isBlank(taskInstance.getHost())) { return Result.error(Status.TASK_INSTANCE_NOT_FOUND); } String host = getHost(taskInstance.getHost()); Result<String> result = new Result<>(Status.SUCCESS.getCode(), Status.SUCCESS.getMsg()); logger.info("log host : {} , logPath : {} , logServer port : {}", host, taskInstance.getLogPath(), Constants.RPC_PORT); StringBuilder log = new StringBuilder(); if (skipLineNum == 0) { String head = String.format(LOG_HEAD_FORMAT, taskInstance.getLogPath(), host, Constants.SYSTEM_LINE_SEPARATOR); log.append(head); } log.append(logClient .rollViewLog(host, Constants.RPC_PORT, taskInstance.getLogPath(), skipLineNum, limit)); result.setData(log.toString()); return result; } /** * get log size * * @param taskInstId task instance id
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java
* @return log byte array */ @Override public byte[] getLogBytes(int taskInstId) { TaskInstance taskInstance = processService.findTaskInstanceById(taskInstId); if (taskInstance == null || StringUtils.isBlank(taskInstance.getHost())) { throw new ServiceException("task instance is null or host is null"); } String host = getHost(taskInstance.getHost()); byte[] head = String.format(LOG_HEAD_FORMAT, taskInstance.getLogPath(), host, Constants.SYSTEM_LINE_SEPARATOR).getBytes(StandardCharsets.UTF_8); return Bytes.concat(head, logClient.getLogBytes(host, Constants.RPC_PORT, taskInstance.getLogPath())); } /** * get host * * @param address address * @return old version return true ,otherwise return false */ private String getHost(String address) { if (Boolean.TRUE.equals(Host.isOldVersion(address))) { return address; } return Host.of(address).getIp(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.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.common; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; import java.util.regex.Pattern; /** * Constants */ public final class Constants { private Constants() { throw new UnsupportedOperationException("Construct Constants"); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * common properties path */ public static final String COMMON_PROPERTIES_PATH = "/common.properties"; /** * alter properties */ public static final int ALERT_RPC_PORT = 50052; /** * registry properties */ public static final String REGISTRY_DOLPHINSCHEDULER_MASTERS = "/nodes/master"; public static final String REGISTRY_DOLPHINSCHEDULER_WORKERS = "/nodes/worker"; public static final String REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers"; public static final String REGISTRY_DOLPHINSCHEDULER_NODE = "/nodes"; public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters"; public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters"; public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers"; public static final String REGISTRY_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters"; /** * fs.defaultFS */ public static final String FS_DEFAULTFS = "fs.defaultFS"; /** * fs s3a endpoint */ public static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint"; /** * fs s3a access key */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key"; /** * fs s3a secret key */ public static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key"; /** * hadoop configuration */ public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE"; public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port"; /** * yarn.resourcemanager.ha.rm.ids */ public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids"; /** * yarn.application.status.address */ public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address"; /** * yarn.job.history.status.address */ public static final String YARN_JOB_HISTORY_STATUS_ADDRESS = "yarn.job.history.status.address"; /** * hdfs configuration * hdfs.root.user */ public static final String HDFS_ROOT_USER = "hdfs.root.user"; /** * hdfs/s3 configuration * resource.upload.path
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path"; /** * data basedir path */ public static final String DATA_BASEDIR_PATH = "data.basedir.path"; /** * dolphinscheduler.env.path */ public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path"; /** * environment properties default path */ public static final String ENV_PATH = "env/dolphinscheduler_env.sh"; /** * resource.view.suffixs */ public static final String RESOURCE_VIEW_SUFFIXS = "resource.view.suffixs"; public static final String RESOURCE_VIEW_SUFFIXS_DEFAULT_VALUE = "txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js"; /** * development.state */ public static final String DEVELOPMENT_STATE = "development.state"; /** * sudo enable */ public static final String SUDO_ENABLE = "sudo.enable"; /** * string true */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String STRING_TRUE = "true"; /** * resource storage type */ public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type"; /** * comma , */ public static final String COMMA = ","; /** * COLON : */ public static final String COLON = ":"; /** * SINGLE_SLASH / */ public static final String SINGLE_SLASH = "/"; /** * DOUBLE_SLASH // */ public static final String DOUBLE_SLASH = "//"; /** * EQUAL SIGN */ public static final String EQUAL_SIGN = "="; /** * date format of yyyy-MM-dd HH:mm:ss */ public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* date format of yyyyMMdd */ public static final String YYYYMMDD = "yyyyMMdd"; /** * date format of yyyyMMddHHmmss */ public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; /** * date format of yyyyMMddHHmmssSSS */ public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; /** * http connect time out */ public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000; /** * http connect request time out */ public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000; /** * httpclient soceket time out */ public static final int SOCKET_TIMEOUT = 60 * 1000; /** * http header */ public static final String HTTP_HEADER_UNKNOWN = "unKnown"; /** * http X-Forwarded-For */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For"; /** * http X-Real-IP */ public static final String HTTP_X_REAL_IP = "X-Real-IP"; /** * UTF-8 */ public static final String UTF_8 = "UTF-8"; /** * user name regex */ public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$"); /** * email regex */ public static final Pattern REGEX_MAIL_NAME = Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"); /** * read permission */ public static final int READ_PERMISSION = 2; /** * write permission */ public static final int WRITE_PERMISSION = 2 * 2; /** * execute permission */ public static final int EXECUTE_PERMISSION = 1; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* default admin permission */ public static final int DEFAULT_ADMIN_PERMISSION = 7; /** * all permissions */ public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION; /** * max task timeout */ public static final int MAX_TASK_TIMEOUT = 24 * 3600; /** * worker host weight */ public static final int DEFAULT_WORKER_HOST_WEIGHT = 100; /** * time unit secong to minutes */ public static final int SEC_2_MINUTES_TIME_UNIT = 60; /*** * * rpc port */ public static final int RPC_PORT = 50051; /** * forbid running task */ public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN"; /** * normal running task
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String FLOWNODE_RUN_FLAG_NORMAL = "NORMAL"; public static final String COMMON_TASK_TYPE = "common"; public static final String DEFAULT = "default"; public static final String PASSWORD = "password"; public static final String XXXXXX = "******"; public static final String NULL = "NULL"; public static final String THREAD_NAME_MASTER_SERVER = "Master-Server"; public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server"; /** * command parameter keys */ public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId"; public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList"; public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId"; public static final String CMD_PARAM_SUB_PROCESS = "processInstanceId"; public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0"; public static final String CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId"; public static final String CMD_PARAM_SUB_PROCESS_DEFINE_CODE = "processDefinitionCode"; public static final String CMD_PARAM_START_NODES = "StartNodeList"; public static final String CMD_PARAM_START_PARAMS = "StartParams"; public static final String CMD_PARAM_FATHER_PARAMS = "fatherParams"; /** * complement data start date */ public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate"; /** * complement data end date */ public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * complement date default cron string */ public static final String DEFAULT_CRON_STRING = "0 0 0 * * ? *"; public static final int SLEEP_TIME_MILLIS = 1000; /** * one second mils */ public static final int SECOND_TIME_MILLIS = 1000; /** * master task instance cache-database refresh interval */ public static final int CACHE_REFRESH_TIME_MILLIS = 20 * 1000; /** * heartbeat for zk info length */ public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 13; /** * jar */ public static final String JAR = "jar"; /** * hadoop */ public static final String HADOOP = "hadoop"; /** * -D <property>=<value> */ public static final String D = "-D"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* exit code success */ public static final int EXIT_CODE_SUCCESS = 0; /** * exit code failure */ public static final int EXIT_CODE_FAILURE = -1; /** * process or task definition failure */ public static final int DEFINITION_FAILURE = -1; /** * process or task definition first version */ public static final int VERSION_FIRST = 1; /** * date format of yyyyMMdd */ public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd"; /** * date format of yyyyMMddHHmmss */ public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss"; /** * system date(yyyyMMddHHmmss) */ public static final String PARAMETER_DATETIME = "system.datetime"; /** * system date(yyyymmdd) today */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate"; /** * system date(yyyymmdd) yesterday */ public static final String PARAMETER_BUSINESS_DATE = "system.biz.date"; /** * ACCEPTED */ public static final String ACCEPTED = "ACCEPTED"; /** * SUCCEEDED */ public static final String SUCCEEDED = "SUCCEEDED"; /** * NEW */ public static final String NEW = "NEW"; /** * NEW_SAVING */ public static final String NEW_SAVING = "NEW_SAVING"; /** * SUBMITTED */ public static final String SUBMITTED = "SUBMITTED"; /** * FAILED */ public static final String FAILED = "FAILED"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* KILLED */ public static final String KILLED = "KILLED"; /** * RUNNING */ public static final String RUNNING = "RUNNING"; /** * underline "_" */ public static final String UNDERLINE = "_"; /** * quartz job prifix */ public static final String QUARTZ_JOB_PRIFIX = "job"; /** * quartz job group prifix */ public static final String QUARTZ_JOB_GROUP_PRIFIX = "jobgroup"; /** * projectId */ public static final String PROJECT_ID = "projectId"; /** * processId */ public static final String SCHEDULE_ID = "scheduleId"; /** * schedule */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String SCHEDULE = "schedule"; /** * application regex */ public static final String APPLICATION_REGEX = "application_\\d+_\\d+"; public static final String PID = SystemUtils.IS_OS_WINDOWS ? "handle" : "pid"; /** * month_begin */ public static final String MONTH_BEGIN = "month_begin"; /** * add_months */ public static final String ADD_MONTHS = "add_months"; /** * month_end */ public static final String MONTH_END = "month_end"; /** * week_begin */ public static final String WEEK_BEGIN = "week_begin"; /** * week_end */ public static final String WEEK_END = "week_end"; /** * timestamp */ public static final String TIMESTAMP = "timestamp";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final char SUBTRACT_CHAR = '-'; public static final char ADD_CHAR = '+'; public static final char MULTIPLY_CHAR = '*'; public static final char DIVISION_CHAR = '/'; public static final char LEFT_BRACE_CHAR = '('; public static final char RIGHT_BRACE_CHAR = ')'; public static final String ADD_STRING = "+"; public static final String STAR = "*"; public static final String DIVISION_STRING = "/"; public static final String LEFT_BRACE_STRING = "("; public static final char P = 'P'; public static final char N = 'N'; public static final String SUBTRACT_STRING = "-"; public static final String GLOBAL_PARAMS = "globalParams"; public static final String LOCAL_PARAMS = "localParams"; public static final String SUBPROCESS_INSTANCE_ID = "subProcessInstanceId"; public static final String PROCESS_INSTANCE_STATE = "processInstanceState"; public static final String PARENT_WORKFLOW_INSTANCE = "parentWorkflowInstance"; public static final String CONDITION_RESULT = "conditionResult"; public static final String SWITCH_RESULT = "switchResult"; public static final String WAIT_START_TIMEOUT = "waitStartTimeout"; public static final String DEPENDENCE = "dependence"; public static final String TASK_LIST = "taskList"; public static final String QUEUE = "queue"; public static final String QUEUE_NAME = "queueName"; public static final int LOG_QUERY_SKIP_LINE_NUMBER = 0; public static final int LOG_QUERY_LIMIT = 4096; /** * master/worker server use for zk */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String MASTER_TYPE = "master"; public static final String WORKER_TYPE = "worker"; public static final String DELETE_OP = "delete"; public static final String ADD_OP = "add"; public static final String ALIAS = "alias"; public static final String CONTENT = "content"; public static final String DEPENDENT_SPLIT = ":||"; public static final long DEPENDENT_ALL_TASK_CODE = 0; /** * preview schedule execute count */ public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5; /** * kerberos */ public static final String KERBEROS = "kerberos"; /** * kerberos expire time */ public static final String KERBEROS_EXPIRE_TIME = "kerberos.expire.time"; /** * java.security.krb5.conf */ public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf"; /** * java.security.krb5.conf.path */ public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path"; /** * hadoop.security.authentication
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication"; /** * hadoop.security.authentication */ public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state"; /** * com.amazonaws.services.s3.enableV4 */ public static final String AWS_S3_V4 = "com.amazonaws.services.s3.enableV4"; /** * loginUserFromKeytab user */ public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username"; /** * loginUserFromKeytab path */ public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path"; /** * task log info format */ public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s"; public static final int[] NOT_TERMINATED_STATES = new int[] { ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal(), ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(), ExecutionStatus.WAITING_THREAD.ordinal(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
ExecutionStatus.WAITING_DEPEND.ordinal() }; public static final int[] RUNNING_PROCESS_STATE = new int[] { ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.SERIAL_WAIT.ordinal() }; /** * status */ public static final String STATUS = "status"; /** * message */ public static final String MSG = "msg"; /** * data total */ public static final String COUNT = "count"; /** * page size */ public static final String PAGE_SIZE = "pageSize"; /** * current page no */ public static final String PAGE_NUMBER = "pageNo"; /** * */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String DATA_LIST = "data"; public static final String TOTAL_LIST = "totalList"; public static final String CURRENT_PAGE = "currentPage"; public static final String TOTAL_PAGE = "totalPage"; public static final String TOTAL = "total"; /** * workflow */ public static final String WORKFLOW_LIST = "workFlowList"; public static final String WORKFLOW_RELATION_LIST = "workFlowRelationList"; /** * session user */ public static final String SESSION_USER = "session.user"; public static final String SESSION_ID = "sessionId"; /** * locale */ public static final String LOCALE_LANGUAGE = "language"; /** * database type */ public static final String MYSQL = "MYSQL"; public static final String HIVE = "HIVE"; public static final String ADDRESS = "address"; public static final String DATABASE = "database"; public static final String OTHER = "other"; /** * session timeout */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final int SESSION_TIME_OUT = 7200; public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024; public static final String UDF = "UDF"; public static final String CLASS = "class"; /** * dataSource sensitive param */ public static final String DATASOURCE_PASSWORD_REGEX = "(?<=((?i)password((\\\\\":\\\\\")|(=')))).*?(?=((\\\\\")|(')))"; /** * default worker group */ public static final String DEFAULT_WORKER_GROUP = "default"; /** * authorize writable perm */ public static final int AUTHORIZE_WRITABLE_PERM = 7; /** * authorize readable perm */ public static final int AUTHORIZE_READABLE_PERM = 4; public static final int NORMAL_NODE_STATUS = 0; public static final int ABNORMAL_NODE_STATUS = 1; public static final int BUSY_NODE_STATUE = 2; public static final String START_TIME = "start time"; public static final String END_TIME = "end time"; public static final String START_END_DATE = "startDate,endDate"; /** * system line separator */ public static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * datasource encryption salt */ public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*"; public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable"; public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt"; /** * network interface preferred */ public static final String DOLPHIN_SCHEDULER_NETWORK_INTERFACE_PREFERRED = "dolphin.scheduler.network.interface.preferred"; /** * network IP gets priority, default inner outer */ public static final String DOLPHIN_SCHEDULER_NETWORK_PRIORITY_STRATEGY = "dolphin.scheduler.network.priority.strategy"; /** * exec shell scripts */ public static final String SH = "sh"; /** * pstree, get pud and sub pid */ public static final String PSTREE = "pstree"; public static final Boolean KUBERNETES_MODE = !StringUtils.isEmpty(System.getenv("KUBERNETES_SERVICE_HOST")) && !StringUtils.isEmpty(System.getenv("KUBERNETES_SERVICE_PORT")); /** * dry run flag */ public static final int DRY_RUN_FLAG_NO = 0; public static final int DRY_RUN_FLAG_YES = 1; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.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.log; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * logger server */ public class LoggerServer {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.java
private static final Logger logger = LoggerFactory.getLogger(LoggerServer.class); /** * netty server */ private final NettyRemotingServer server; /** * netty server config */ private final NettyServerConfig serverConfig; /** * loggger request processor */ private final LoggerRequestProcessor requestProcessor; public LoggerServer() { this.serverConfig = new NettyServerConfig(); this.serverConfig.setListenPort(Constants.RPC_PORT); this.server = new NettyRemotingServer(serverConfig); this.requestProcessor = new LoggerRequestProcessor();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerServer.java
this.server.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, requestProcessor, requestProcessor.getExecutor()); this.server.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor()); this.server.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor()); this.server.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, requestProcessor, requestProcessor.getExecutor()); } /** * main launches the server from the command line. * @param args arguments */ public static void main(String[] args) { final LoggerServer server = new LoggerServer(); server.start(); } /** * server start */ public void start() { this.server.start(); logger.info("logger server started, listening on port : {}", Constants.RPC_PORT); Runtime.getRuntime().addShutdownHook(new Thread(LoggerServer.this::stop)); } /** * stop */ public void stop() { this.server.close(); logger.info("logger server shut down"); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.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
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
*/ package org.apache.dolphinscheduler.server.utils; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.utils.CommonUtils; import org.apache.dolphinscheduler.common.utils.FileUtils; import org.apache.dolphinscheduler.common.utils.HadoopUtils; import org.apache.dolphinscheduler.common.utils.LoggerUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.common.utils.PropertyUtils; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * mainly used to get the start command line of a process. */ public class ProcessUtils { private static final Logger logger = LoggerFactory.getLogger(ProcessUtils.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
/** * Initialization regularization, solve the problem of pre-compilation performance, * avoid the thread safety problem of multi-thread operation */ private static final Pattern MACPATTERN = Pattern.compile("-[+|-]-\\s(\\d+)"); /** * Expression of PID recognition in Windows scene */ private static final Pattern WINDOWSATTERN = Pattern.compile("\\w+\\((\\d+)\\)"); /** * kill yarn application. * * @param appIds app id list * @param logger logger * @param tenantCode tenant code * @param executePath execute path */ public static void cancelApplication(List<String> appIds, Logger logger, String tenantCode, String executePath) { if (appIds == null || appIds.isEmpty()) { return; } for (String appId : appIds) { try { ExecutionStatus applicationStatus = HadoopUtils.getInstance().getApplicationStatus(appId); if (!applicationStatus.typeIsFinished()) { String commandFile = String.format("%s/%s.kill", executePath, appId); String cmd = getKerberosInitCommand() + "yarn application -kill " + appId; execYarnKillCommand(logger, tenantCode, appId, commandFile, cmd); } } catch (Exception e) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
logger.error("Get yarn application app id [{}}] status failed", appId, e); } } } /** * get kerberos init command */ static String getKerberosInitCommand() { logger.info("get kerberos init command"); StringBuilder kerberosCommandBuilder = new StringBuilder(); boolean hadoopKerberosState = PropertyUtils.getBoolean(Constants.HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE, false); if (hadoopKerberosState) { kerberosCommandBuilder.append("export KRB5_CONFIG=") .append(PropertyUtils.getString(Constants.JAVA_SECURITY_KRB5_CONF_PATH)) .append("\n\n") .append(String.format("kinit -k -t %s %s || true", PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_PATH), PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_USERNAME))) .append("\n\n"); logger.info("kerberos init command: {}", kerberosCommandBuilder); } return kerberosCommandBuilder.toString(); } /** * build kill command for yarn application * * @param logger logger * @param tenantCode tenant code * @param appId app id * @param commandFile command file * @param cmd cmd */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
private static void execYarnKillCommand(Logger logger, String tenantCode, String appId, String commandFile, String cmd) { try { StringBuilder sb = new StringBuilder(); sb.append("#!/bin/sh\n"); sb.append("BASEDIR=$(cd `dirname $0`; pwd)\n"); sb.append("cd $BASEDIR\n"); if (CommonUtils.getSystemEnvPath() != null) { sb.append("source ").append(CommonUtils.getSystemEnvPath()).append("\n"); } sb.append("\n\n"); sb.append(cmd); File f = new File(commandFile); if (!f.exists()) { org.apache.commons.io.FileUtils.writeStringToFile(new File(commandFile), sb.toString(), StandardCharsets.UTF_8); } String runCmd = String.format("%s %s", Constants.SH, commandFile); runCmd = OSUtils.getSudoCmd(tenantCode, runCmd); logger.info("kill cmd:{}", runCmd); OSUtils.exeCmd(runCmd); } catch (Exception e) { logger.error(String.format("Kill yarn application app id [%s] failed: [%s]", appId, e.getMessage())); } } /** * get pids str. * * @param processId process id * @return pids pid String * @throws Exception exception */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
public static String getPidsStr(int processId) throws Exception { List<String> pidList = new ArrayList<>(); Matcher mat = null; if (SystemUtils.IS_OS_MAC) { String pids = OSUtils.exeCmd(String.format("%s -sp %d", Constants.PSTREE, processId)); if (null != pids) { mat = MACPATTERN.matcher(pids); } } else { String pids = OSUtils.exeCmd(String.format("%s -p %d", Constants.PSTREE, processId)); mat = WINDOWSATTERN.matcher(pids); } if (null != mat) { while (mat.find()) { pidList.add(mat.group(1)); } } if (CommonUtils.isSudoEnable() && !pidList.isEmpty()) { pidList = pidList.subList(1, pidList.size()); } return String.join(" ", pidList).trim(); } /** * find logs and kill yarn tasks. * * @param taskExecutionContext taskExecutionContext * @return yarn application ids */ public static List<String> killYarnJob(TaskExecutionContext taskExecutionContext) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
try { Thread.sleep(Constants.SLEEP_TIME_MILLIS); String log; try (LogClientService logClient = new LogClientService()) { log = logClient.viewLog(Host.of(taskExecutionContext.getHost()).getIp(), Constants.RPC_PORT, taskExecutionContext.getLogPath()); } if (!StringUtils.isEmpty(log)) { if (StringUtils.isEmpty(taskExecutionContext.getExecutePath())) { taskExecutionContext.setExecutePath(FileUtils.getProcessExecDir(taskExecutionContext.getProjectCode(), taskExecutionContext.getProcessDefineCode(), taskExecutionContext.getProcessDefineVersion(), taskExecutionContext.getProcessInstanceId(), taskExecutionContext.getTaskInstanceId())); } FileUtils.createWorkDirIfAbsent(taskExecutionContext.getExecutePath()); List<String> appIds = LoggerUtils.getAppIds(log, logger); if (CollectionUtils.isNotEmpty(appIds)) { cancelApplication(appIds, logger, taskExecutionContext.getTenantCode(), taskExecutionContext.getExecutePath()); return appIds; } } } catch (Exception e) { logger.error("kill yarn job failure", e); } return Collections.emptyList(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.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.worker; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.IStoppable; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager; import org.apache.dolphinscheduler.server.worker.processor.DBTaskAckProcessor; import org.apache.dolphinscheduler.server.worker.processor.DBTaskResponseProcessor; import org.apache.dolphinscheduler.server.worker.processor.HostUpdateProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor; import org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor; import org.apache.dolphinscheduler.server.worker.registry.WorkerRegistryClient; import org.apache.dolphinscheduler.server.worker.runner.RetryReportTaskStatusThread; import org.apache.dolphinscheduler.server.worker.runner.WorkerManagerThread; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import java.util.Set; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * worker server */ @ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = { @ComponentScan.Filter(type = FilterType.REGEX, pattern = { "org.apache.dolphinscheduler.server.master.*", "org.apache.dolphinscheduler.server.monitor.*", "org.apache.dolphinscheduler.server.log.*",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
"org.apache.dolphinscheduler.alert.*" }) }) @EnableTransactionManagement public class WorkerServer implements IStoppable { /** * logger */ private static final Logger logger = LoggerFactory.getLogger(WorkerServer.class); /** * netty remote server */ private NettyRemotingServer nettyRemotingServer; /** * worker config */ @Autowired private WorkerConfig workerConfig; /** * spring application context * only use it for initialization */ @Autowired private SpringApplicationContext springApplicationContext; /** * alert model netty remote server */ private AlertClientService alertClientService; @Autowired private RetryReportTaskStatusThread retryReportTaskStatusThread;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
@Autowired private WorkerManagerThread workerManagerThread; /** * worker registry */ @Autowired private WorkerRegistryClient workerRegistryClient; @Autowired private TaskPluginManager taskPluginManager; /** * worker server startup, not use web service * * @param args arguments */ public static void main(String[] args) { Thread.currentThread().setName(Constants.THREAD_NAME_WORKER_SERVER); new SpringApplicationBuilder(WorkerServer.class) .profiles("worker") .run(args); } /** * worker server run */ @PostConstruct public void run() { alertClientService = new AlertClientService(workerConfig.getAlertListenHost(), Constants.ALERT_RPC_PORT); NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(workerConfig.getListenPort());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
this.nettyRemotingServer = new NettyRemotingServer(serverConfig); this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor(alertClientService, taskPluginManager)); this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, new TaskKillProcessor()); this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_ACK, new DBTaskAckProcessor()); this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_RESPONSE, new DBTaskResponseProcessor()); this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, new HostUpdateProcessor()); this.nettyRemotingServer.start(); try { this.workerRegistryClient.registry(); this.workerRegistryClient.setRegistryStoppable(this); Set<String> workerZkPaths = this.workerRegistryClient.getWorkerZkPaths(); this.workerRegistryClient.handleDeadServer(workerZkPaths, NodeType.WORKER, Constants.DELETE_OP); } catch (Exception e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } this.workerManagerThread.start(); this.retryReportTaskStatusThread.start(); /* * registry hooks, which are called before the process exits */ Runtime.getRuntime().addShutdownHook(new Thread(() -> { if (Stopper.isRunning()) { close("shutdownHook"); } })); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
public void close(String cause) { try { if (Stopper.isStopped()) { return; } logger.info("worker server is stopping ..., cause : {}", cause); Stopper.stop(); try { Thread.sleep(3000L); } catch (Exception e) { logger.warn("thread sleep exception", e); } this.nettyRemotingServer.close(); this.workerRegistryClient.unRegistry(); this.alertClientService.close(); this.springApplicationContext.close(); } catch (Exception e) { logger.error("worker server stop exception ", e); } } @Override public void stop(String cause) { close(cause); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.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.worker.processor; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.LoggerUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.TaskKillRequestCommand; import org.apache.dolphinscheduler.remote.command.TaskKillResponseCommand; import org.apache.dolphinscheduler.remote.processor.NettyRemoteChannel; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java
import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.remote.utils.Pair; import org.apache.dolphinscheduler.server.utils.ProcessUtils; import org.apache.dolphinscheduler.server.worker.config.WorkerConfig; import org.apache.dolphinscheduler.server.worker.runner.WorkerManagerThread; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext; import org.apache.dolphinscheduler.spi.task.TaskExecutionContextCacheManager; import org.apache.dolphinscheduler.spi.task.request.TaskRequest; import org.apache.commons.lang.StringUtils; import java.util.Collections; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import io.netty.channel.Channel; /** * task kill processor */ public class TaskKillProcessor implements NettyRequestProcessor { private final Logger logger = LoggerFactory.getLogger(TaskKillProcessor.class); /** * worker config */ private final WorkerConfig workerConfig; /** * task callback service */ private final TaskCallbackService taskCallbackService;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java
/* * task execute manager */ private final WorkerManagerThread workerManager; public TaskKillProcessor() { this.taskCallbackService = SpringApplicationContext.getBean(TaskCallbackService.class); this.workerConfig = SpringApplicationContext.getBean(WorkerConfig.class); this.workerManager = SpringApplicationContext.getBean(WorkerManagerThread.class); } /** * task kill process * * @param channel channel channel * @param command command command */ @Override public void process(Channel channel, Command command) { Preconditions.checkArgument(CommandType.TASK_KILL_REQUEST == command.getType(), String.format("invalid command type : %s", command.getType())); TaskKillRequestCommand killCommand = JSONUtils.parseObject(command.getBody(), TaskKillRequestCommand.class); logger.info("received kill command : {}", killCommand); Pair<Boolean, List<String>> result = doKill(killCommand); taskCallbackService.addRemoteChannel(killCommand.getTaskInstanceId(), new NettyRemoteChannel(channel, command.getOpaque())); TaskKillResponseCommand taskKillResponseCommand = buildKillTaskResponseCommand(killCommand, result); taskCallbackService.sendResult(taskKillResponseCommand.getTaskInstanceId(), taskKillResponseCommand.convert2Command()); TaskExecutionContextCacheManager.removeByTaskInstanceId(taskKillResponseCommand.getTaskInstanceId()); } /** * do kill *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java
* @return kill result */ private Pair<Boolean, List<String>> doKill(TaskKillRequestCommand killCommand) { boolean processFlag = true; List<String> appIds = Collections.emptyList(); int taskInstanceId = killCommand.getTaskInstanceId(); TaskRequest taskRequest = TaskExecutionContextCacheManager.getByTaskInstanceId(taskInstanceId); TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(JSONUtils.toJsonString(taskRequest), TaskExecutionContext.class); try { Integer processId = taskExecutionContext.getProcessId(); if (processId.equals(0)) { workerManager.killTaskBeforeExecuteByInstanceId(taskInstanceId); TaskExecutionContextCacheManager.removeByTaskInstanceId(taskInstanceId); logger.info("the task has not been executed and has been cancelled, task id:{}", taskInstanceId); return Pair.of(true, appIds); } String pidsStr = ProcessUtils.getPidsStr(taskExecutionContext.getProcessId()); if (!StringUtils.isEmpty(pidsStr)) { String cmd = String.format("kill -9 %s", pidsStr); cmd = OSUtils.getSudoCmd(taskExecutionContext.getTenantCode(), cmd); logger.info("process id:{}, cmd:{}", taskExecutionContext.getProcessId(), cmd); OSUtils.exeCmd(cmd); } } catch (Exception e) { processFlag = false; logger.error("kill task error", e); } Pair<Boolean, List<String>> yarnResult = killYarnJob(Host.of(taskExecutionContext.getHost()).getIp(), taskExecutionContext.getLogPath(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java
taskExecutionContext.getExecutePath(), taskExecutionContext.getTenantCode()); return Pair.of(processFlag && yarnResult.getLeft(), yarnResult.getRight()); } /** * build TaskKillResponseCommand * * @param killCommand kill command * @param result exe result * @return build TaskKillResponseCommand */ private TaskKillResponseCommand buildKillTaskResponseCommand(TaskKillRequestCommand killCommand, Pair<Boolean, List<String>> result) { TaskKillResponseCommand taskKillResponseCommand = new TaskKillResponseCommand(); taskKillResponseCommand.setStatus(result.getLeft() ? ExecutionStatus.SUCCESS.getCode() : ExecutionStatus.FAILURE.getCode()); taskKillResponseCommand.setAppIds(result.getRight()); TaskRequest taskRequest = TaskExecutionContextCacheManager.getByTaskInstanceId(killCommand.getTaskInstanceId()); if (taskRequest == null) { return taskKillResponseCommand; } TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(JSONUtils.toJsonString(taskRequest), TaskExecutionContext.class); if (taskExecutionContext != null) { taskKillResponseCommand.setTaskInstanceId(taskExecutionContext.getTaskInstanceId()); taskKillResponseCommand.setHost(taskExecutionContext.getHost()); taskKillResponseCommand.setProcessId(taskExecutionContext.getProcessId()); } return taskKillResponseCommand; } /** * kill yarn job
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskKillProcessor.java
* * @param host host * @param logPath logPath * @param executePath executePath * @param tenantCode tenantCode * @return Pair<Boolean, List < String>> yarn kill result */ private Pair<Boolean, List<String>> killYarnJob(String host, String logPath, String executePath, String tenantCode) { try (LogClientService logClient = new LogClientService();) { logger.info("view log host : {},logPath : {}", host, logPath); String log = logClient.viewLog(host, Constants.RPC_PORT, logPath); List<String> appIds = Collections.emptyList(); if (!StringUtils.isEmpty(log)) { appIds = LoggerUtils.getAppIds(log, logger); if (StringUtils.isEmpty(executePath)) { logger.error("task instance execute path is empty"); throw new RuntimeException("task instance execute path is empty"); } if (appIds.size() > 0) { ProcessUtils.cancelApplication(appIds, logger, tenantCode, executePath); } } return Pair.of(true, appIds); } catch (Exception e) { logger.error("kill yarn job error", e); } return Pair.of(false, Collections.emptyList()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/log/LoggerServerTest.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.log; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.utils.FileUtils; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.commons.lang.StringUtils; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class LoggerServerTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/log/LoggerServerTest.java
private LoggerServer loggerServer; private LogClientService logClientService; @Before
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/log/LoggerServerTest.java
public void startServerAndClient() { this.loggerServer = new LoggerServer(); this.loggerServer.start(); this.logClientService = new LogClientService(); } @Test public void testRollViewLog() throws IOException { String expectedTmpDemoString = "testRolloViewLog"; org.apache.commons.io.FileUtils.writeStringToFile(new File("/tmp/demo.txt"), expectedTmpDemoString, Charset.defaultCharset()); String resultTmpDemoString = this.logClientService.rollViewLog( "localhost", Constants.RPC_PORT,"/tmp/demo.txt", 0, 1000); Assert.assertEquals(expectedTmpDemoString, resultTmpDemoString.replaceAll("[\r|\n|\t]", StringUtils.EMPTY)); FileUtils.deleteFile("/tmp/demo.txt"); } @Test public void testRemoveTaskLog() throws IOException { String expectedTmpRemoveString = "testRemoveTaskLog"; org.apache.commons.io.FileUtils.writeStringToFile(new File("/tmp/remove.txt"), expectedTmpRemoveString, Charset.defaultCharset()); Boolean b = this.logClientService.removeTaskLog("localhost", Constants.RPC_PORT,"/tmp/remove.txt"); Assert.assertTrue(b); String result = this.logClientService.viewLog("localhost", Constants.RPC_PORT,"/tmp/demo.txt"); Assert.assertEquals(StringUtils.EMPTY, result); } @After public void stopServerAndClient() { this.loggerServer.stop(); this.logClientService.close(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.service.process; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_EMPTY_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_FATHER_PARAMS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; import static org.apache.dolphinscheduler.common.Constants.LOCAL_PARAMS; import static java.util.stream.Collectors.toSet; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TimeoutFlag; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.graph.DAG; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; import org.apache.dolphinscheduler.common.process.ProcessDag;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.TaskTimeoutParameter; import org.apache.dolphinscheduler.common.task.subprocess.SubProcessParameters; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.TaskParametersUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.DagData; import org.apache.dolphinscheduler.dao.entity.DataSource; import org.apache.dolphinscheduler.dao.entity.Environment; import org.apache.dolphinscheduler.dao.entity.ErrorCommand; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog; import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.dao.entity.UdfFunc; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.CommandMapper; import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper; import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper; import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper; import org.apache.dolphinscheduler.dao.utils.DagHelper; import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand; import org.apache.dolphinscheduler.remote.processor.StateEventCallbackService; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.cache.processor.TenantCacheProcessor; import org.apache.dolphinscheduler.service.cache.processor.UserCacheProcessor; import org.apache.dolphinscheduler.service.exceptions.ServiceException; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.spi.enums.ResourceType; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.facebook.presto.jdbc.internal.guava.collect.Lists; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; /** * process relative dao that some mappers in this. */ @Component public class ProcessService { private final Logger logger = LoggerFactory.getLogger(getClass()); private final int[] stateArray = new int[]{ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal()}; @Autowired private UserCacheProcessor userCacheProcessor; @Autowired private ProcessDefinitionMapper processDefineMapper; @Autowired private ProcessDefinitionLogMapper processDefineLogMapper; @Autowired private ProcessInstanceMapper processInstanceMapper; @Autowired private DataSourceMapper dataSourceMapper; @Autowired private ProcessInstanceMapMapper processInstanceMapMapper; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private CommandMapper commandMapper; @Autowired private ScheduleMapper scheduleMapper; @Autowired private UdfFuncMapper udfFuncMapper; @Autowired private ResourceMapper resourceMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ErrorCommandMapper errorCommandMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@Autowired private TenantCacheProcessor tenantCacheProcessor; @Autowired private ProjectMapper projectMapper; @Autowired private TaskDefinitionMapper taskDefinitionMapper; @Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private ProcessTaskRelationLogMapper processTaskRelationLogMapper; @Autowired StateEventCallbackService stateEventCallbackService; @Autowired private EnvironmentMapper environmentMapper; /** * handle Command (construct ProcessInstance from Command) , wrapped in transaction * * @param logger logger * @param host host * @param command found command * @return process instance */ @Transactional public ProcessInstance handleCommand(Logger logger, String host, Command command, HashMap<String, ProcessDefinition> processDefinitionCacheMaps) { ProcessInstance processInstance = constructProcessInstance(command, host, processDefinitionCacheMaps); if (processInstance == null) { logger.error("scan command, command parameter is error: {}", command);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
moveToErrorCommand(command, "process instance is null"); return null; } processInstance.setCommandType(command.getCommandType()); processInstance.addHistoryCmd(command.getCommandType()); ProcessDefinition processDefinition = this.findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); if (processDefinition.getExecutionType().typeIsSerial()) { saveSerialProcess(processInstance, processDefinition); if (processInstance.getState() != ExecutionStatus.SUBMITTED_SUCCESS) { setSubProcessParam(processInstance); deleteCommandWithCheck(command.getId()); return null; } } else { saveProcessInstance(processInstance); } setSubProcessParam(processInstance); deleteCommandWithCheck(command.getId()); return processInstance; } private void saveSerialProcess(ProcessInstance processInstance, ProcessDefinition processDefinition) { processInstance.setState(ExecutionStatus.SERIAL_WAIT); saveProcessInstance(processInstance); if (processDefinition.getExecutionType().typeIsSerialWait()) { while (true) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (CollectionUtils.isEmpty(runningProcessInstances)) { processInstance.setState(ExecutionStatus.SUBMITTED_SUCCESS); saveProcessInstance(processInstance); return; } ProcessInstance runningProcess = runningProcessInstances.get(0); if (this.processInstanceMapper.updateNextProcessIdById(processInstance.getId(), runningProcess.getId())) { return; } } } else if (processDefinition.getExecutionType().typeIsSerialDiscard()) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId()); if (CollectionUtils.isEmpty(runningProcessInstances)) { processInstance.setState(ExecutionStatus.STOP); saveProcessInstance(processInstance); } } else if (processDefinition.getExecutionType().typeIsSerialPriority()) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId()); if (CollectionUtils.isNotEmpty(runningProcessInstances)) { for (ProcessInstance info : runningProcessInstances) { info.setCommandType(CommandType.STOP); info.addHistoryCmd(CommandType.STOP); info.setState(ExecutionStatus.READY_STOP); int update = updateProcessInstance(info); if (update > 0) { String host = info.getHost(); String address = host.split(":")[0];
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
int port = Integer.parseInt(host.split(":")[1]); StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand( info.getId(), 0, info.getState(), info.getId(), 0 ); try { stateEventCallbackService.sendResult(address, port, stateEventChangeCommand.convert2Command()); } catch (Exception e) { logger.error("sendResultError"); } } } } } } /** * save error command, and delete original command * * @param command command * @param message message */ public void moveToErrorCommand(Command command, String message) { ErrorCommand errorCommand = new ErrorCommand(command, message); this.errorCommandMapper.insert(errorCommand); this.commandMapper.deleteById(command.getId()); } /** * set process waiting thread * * @param command command * @param processInstance processInstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,229
[Feature][server port] server port custom config
**Describe the feature** all application can custom config server port
https://github.com/apache/dolphinscheduler/issues/5229
https://github.com/apache/dolphinscheduler/pull/6947
100a9ba3fc21764158593bd33e2b261b0ef39982
0dcff1425a28da0ce0004fc3e594b97d080c5fd9
"2021-04-07T09:22:45Z"
java
"2021-11-30T16:21:03Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return process instance */ private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { processInstance.setState(ExecutionStatus.WAITING_THREAD); if (command.getCommandType() != CommandType.RECOVER_WAITING_THREAD) { processInstance.addHistoryCmd(command.getCommandType()); } saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); createRecoveryWaitingThreadCommand(command, processInstance); return null; } /** * insert one command * * @param command command * @return create result */ public int createCommand(Command command) { int result = 0; if (command != null) { result = commandMapper.insert(command); } return result; } /** * get command page */ public List<Command> findCommandPage(int pageSize, int pageNumber) { return commandMapper.queryCommandPage(pageSize, pageNumber * pageSize);