status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes()); taskInstance.setRetryInterval(taskNode.getRetryInterval()); taskInstance.setTaskParams(taskNode.getTaskParams()); taskInstance.setTaskGroupId(taskNode.getTaskGroupId()); taskInstance.setTaskGroupProrty(taskNode.getTaskGroupProrty()); f (taskNode.getTaskInstanceProrty() == null) { taskInstance.setTaskInstanceProrty(Prorty.MEDIUM); } else { taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty()); } Strng processWorkerGroup = processInstance.getWorkerGroup(); processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup; Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup(); Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode(); Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode(); f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { taskInstance.setWorkerGroup(processWorkerGroup); taskInstance.setEnvronmentCode(processEnvronmentCode); } else { taskInstance.setWorkerGroup(taskWorkerGroup); taskInstance.setEnvronmentCode(taskEnvronmentCode); } f (!taskInstance.getEnvronmentCode().equals(-1L)) { Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode()); f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) { taskInstance.setEnvronmentConfg(envronment.getConfg());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} } taskInstance.setDelayTme(taskNode.getDelayTme()); return taskInstance; } publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) { Map<Strng, Property> allProperty = new HashMap<>(); Map<Strng, TaskInstance> allTaskInstance = new HashMap<>(); f (CollectonUtls.sNotEmpty(preTask)) { for (Strng preTaskCode : preTask) { Integer taskId = completeTaskMap.get(Long.parseLong(preTaskCode)); f (taskId == null) { contnue; } TaskInstance preTaskInstance = taskInstanceMap.get(taskId); f (preTaskInstance == null) { contnue; } Strng preVarPool = preTaskInstance.getVarPool(); f (StrngUtls.sNotEmpty(preVarPool)) { Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class); for (Property nfo : propertes) { setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo); } } } f (allProperty.sze() > 0) { taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values())); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} } prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) { thsProperty.setDrect(Drect.IN); Strng proName = thsProperty.getProp(); f (allProperty.contansKey(proName)) { Property otherPro = allProperty.get(proName); f (StrngUtls.sEmpty(thsProperty.getValue())) { allProperty.put(proName, otherPro); } else f (StrngUtls.sNotEmpty(otherPro.getValue())) { TaskInstance otherTask = allTaskInstance.get(proName); f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } else { allProperty.put(proName, otherPro); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} } /** * get complete task nstance map, taskCode as key */ prvate Map<Strng, TaskInstance> getCompleteTaskInstanceMap() { Map<Strng, TaskInstance> completeTaskInstanceMap = new HashMap<>(); for (Integer taskInstanceId : completeTaskMap.values()) { TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId); completeTaskInstanceMap.put(Long.toStrng(taskInstance.getTaskCode()), taskInstance); } return completeTaskInstanceMap; } /** * get vald task lst */ prvate Lst<TaskInstance> getValdTaskLst() { Lst<TaskInstance> valdTaskInstanceLst = new ArrayLst<>(); for (Integer taskInstanceId : valdTaskMap.values()) { valdTaskInstanceLst.add(taskInstanceMap.get(taskInstanceId)); } return valdTaskInstanceLst; } prvate vod submtPostNode(Strng parentNodeCode) { Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeCode, skpTaskNodeMap, dag, getCompleteTaskInstanceMap()); Lst<TaskInstance> taskInstances = new ArrayLst<>(); for (Strng taskNode : submtTaskNodeLst) { TaskNode taskNodeObject = dag.getNode(taskNode); f (checkTaskInstanceByCode(taskNodeObject.getCode())) { contnue;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} TaskInstance task = createTaskInstance(processInstance, taskNodeObject); taskInstances.add(task); } f (StrngUtls.sNotEmpty(parentNodeCode) && dag.getEndNode().contans(parentNodeCode)){ TaskInstance endTaskInstance = taskInstanceMap.get(completeTaskMap.get(NumberUtls.toLong(parentNodeCode))); Strng taskInstanceVarPool = endTaskInstance.getVarPool(); f(StrngUtls.sNotEmpty(taskInstanceVarPool)) { Set<Property> taskPropertes = JSONUtls.toLst(taskInstanceVarPool, Property.class) .stream().collect(Collectors.toSet()); Strng processInstanceVarPool = processInstance.getVarPool(); f (StrngUtls.sNotEmpty(processInstanceVarPool)) { Set<Property> propertes = JSONUtls.toLst(processInstanceVarPool, Property.class) .stream().collect(Collectors.toSet()); propertes.addAll(taskPropertes); processInstance.setVarPool(JSONUtls.toJsonStrng(propertes)); }else{ processInstance.setVarPool(JSONUtls.toJsonStrng(taskPropertes)); } } } for (TaskInstance task : taskInstances) { f (readyToSubmtTaskQueue.contans(task)) { contnue; } f (task.getId() > 0 && completeTaskMap.contansKey(task.getTaskCode())) { logger.nfo("task {} has already run success", task.getName()); contnue;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} f (task.getState().typeIsPause() || task.getState().typeIsCancel()) { logger.nfo("task {} stopped, the state s {}", task.getName(), task.getState()); contnue; } addTaskToStandByLst(task); } submtStandByTask(); updateProcessInstanceState(); } /** * determne whether the dependences of the task node are complete * * @return DependResult */ prvate DependResult sTaskDepsComplete(Strng taskCode) { Collecton<Strng> startNodes = dag.getBegnNode(); f (startNodes.contans(taskCode)) { return DependResult.SUCCESS; } TaskNode taskNode = dag.getNode(taskCode); Lst<Strng> ndrectDepCodeLst = new ArrayLst<>(); setIndrectDepLst(taskCode, ndrectDepCodeLst); for (Strng depsNode : ndrectDepCodeLst) { f (dag.contansNode(depsNode) && !skpTaskNodeMap.contansKey(depsNode)) { Long despNodeTaskCode = Long.parseLong(depsNode); f (!completeTaskMap.contansKey(despNodeTaskCode)) { return DependResult.WAITING;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} Integer depsTaskId = completeTaskMap.get(despNodeTaskCode); ExecutonStatus depTaskState = taskInstanceMap.get(depsTaskId).getState(); f (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) { return DependResult.NON_EXEC; } f (taskNode.sCondtonsTask() || taskNode.sBlockngTask()) { contnue; } f (!dependTaskSuccess(depsNode, taskCode)) { return DependResult.FAILED; } } } logger.nfo("taskCode: {} completeDependTaskLst: {}", taskCode, Arrays.toStrng(completeTaskMap.keySet().toArray())); return DependResult.SUCCESS; } /** * Ths functon s specally used to handle the dependency stuaton where the parent node s a prohbted node. * When the parent node s a forbdden node, the dependency relatonshp should contnue to be traced * * @param taskCode taskCode * @param ndrectDepCodeLst All ndrectly dependent nodes */ prvate vod setIndrectDepLst(Strng taskCode, Lst<Strng> ndrectDepCodeLst) { TaskNode taskNode = dag.getNode(taskCode); Lst<Strng> depCodeLst = taskNode.getDepLst(); for (Strng depsNode : depCodeLst) { f (forbddenTaskMap.contansKey(Long.parseLong(depsNode))) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
setIndrectDepLst(depsNode, ndrectDepCodeLst); } else { ndrectDepCodeLst.add(depsNode); } } } /** * depend node s completed, but here need check the condton task branch s the next node */ prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) { f (dag.getNode(dependNodeName).sCondtonsTask()) { Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeMap, dag, getCompleteTaskInstanceMap()); f (!nextTaskLst.contans(nextNodeName)) { return false; } } else { long taskCode = Long.parseLong(dependNodeName); Integer taskInstanceId = completeTaskMap.get(taskCode); ExecutonStatus depTaskState = taskInstanceMap.get(taskInstanceId).getState(); f (depTaskState.typeIsFalure()) { return false; } } return true; } /** * query task nstance by complete state * * @param state state
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* @return task nstance lst */ prvate Lst<TaskInstance> getCompleteTaskByState(ExecutonStatus state) { Lst<TaskInstance> resultLst = new ArrayLst<>(); for (Integer taskInstanceId : completeTaskMap.values()) { TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId); f (taskInstance != null && taskInstance.getState() == state) { resultLst.add(taskInstance); } } return resultLst; } /** * where there are ongong tasks * * @param state state * @return ExecutonStatus */ prvate ExecutonStatus runnngState(ExecutonStatus state) { f (state == ExecutonStatus.READY_STOP || state == ExecutonStatus.READY_PAUSE || state == ExecutonStatus.WAITING_THREAD || state == ExecutonStatus.READY_BLOCK || state == ExecutonStatus.DELAY_EXECUTION) { return state; } else { return ExecutonStatus.RUNNING_EXECUTION; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * exsts falure task,contans submt falure、dependency falure,execute falure(retry after) * * @return Boolean whether has faled task */ prvate boolean hasFaledTask() { f (ths.taskFaledSubmt) { return true; } f (ths.errorTaskMap.sze() > 0) { return true; } return ths.dependFaledTaskMap.sze() > 0; } /** * process nstance falure * * @return Boolean whether process nstance faled */ prvate boolean processFaled() { f (hasFaledTask()) { f (processInstance.getFalureStrategy() == FalureStrategy.END) { return true; } f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE) { return readyToSubmtTaskQueue.sze() == 0 && actveTaskProcessorMaps.sze() == 0 && watToRetryTaskInstanceMap.sze() == 0; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return false; } /** * whether task for watng thread * * @return Boolean whether has watng thread task */ prvate boolean hasWatngThreadTask() { Lst<TaskInstance> watngLst = getCompleteTaskByState(ExecutonStatus.WAITING_THREAD); return CollectonUtls.sNotEmpty(watngLst); } /** * prepare for pause * 1,faled retry task n the preparaton queue , returns to falure drectly * 2,exsts pause task,complement not completed, pendng submsson of tasks, return to suspenson * 3,success * * @return ExecutonStatus */ prvate ExecutonStatus processReadyPause() { f (hasRetryTaskInStandBy()) { return ExecutonStatus.FAILURE; } Lst<TaskInstance> pauseLst = getCompleteTaskByState(ExecutonStatus.PAUSE); f (CollectonUtls.sNotEmpty(pauseLst) || processInstance.sBlocked() || !sComplementEnd() || readyToSubmtTaskQueue.sze() > 0) { return ExecutonStatus.PAUSE; } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return ExecutonStatus.SUCCESS; } } /** * prepare for block * f process has tasks stll runnng, pause them * f readyToSubmtTaskQueue s not empty, kll them * else return block status drectly * * @return ExecutonStatus */ prvate ExecutonStatus processReadyBlock() { f (actveTaskProcessorMaps.sze() > 0) { for (ITaskProcessor taskProcessor : actveTaskProcessorMaps.values()) { f (!TASK_TYPE_BLOCKING.equals(taskProcessor.getType())) { taskProcessor.acton(TaskActon.PAUSE); } } } f (readyToSubmtTaskQueue.sze() > 0) { for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) { ter.next().setState(ExecutonStatus.KILL); } } return ExecutonStatus.BLOCK; } /** * generate the latest process nstance status by the tasks state * * @return process nstance executon status
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
*/ prvate ExecutonStatus getProcessInstanceState(ProcessInstance nstance) { ExecutonStatus state = nstance.getState(); f (actveTaskProcessorMaps.sze() > 0 || hasRetryTaskInStandBy()) { // actve return runnngState(state); } // block f (state == ExecutonStatus.READY_BLOCK) { return processReadyBlock(); } // watng thread f (hasWatngThreadTask()) { return ExecutonStatus.WAITING_THREAD; } // pause f (state == ExecutonStatus.READY_PAUSE) { return processReadyPause(); } // stop f (state == ExecutonStatus.READY_STOP) { Lst<TaskInstance> stopLst = getCompleteTaskByState(ExecutonStatus.STOP); Lst<TaskInstance> kllLst = getCompleteTaskByState(ExecutonStatus.KILL); Lst<TaskInstance> falLst = getCompleteTaskByState(ExecutonStatus.FAILURE); f (CollectonUtls.sNotEmpty(stopLst) || CollectonUtls.sNotEmpty(kllLst) || CollectonUtls.sNotEmpty(falLst) || !sComplementEnd()) { return ExecutonStatus.STOP; } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return ExecutonStatus.SUCCESS; } } // process falure f (processFaled()) { return ExecutonStatus.FAILURE; } // success f (state == ExecutonStatus.RUNNING_EXECUTION) { Lst<TaskInstance> kllTasks = getCompleteTaskByState(ExecutonStatus.KILL); f (readyToSubmtTaskQueue.sze() > 0 || watToRetryTaskInstanceMap.sze() > 0) { //tasks cu return ExecutonStatus.RUNNING_EXECUTION; } else f (CollectonUtls.sNotEmpty(kllTasks)) { // tasks m return ExecutonStatus.FAILURE; } else { // f the return ExecutonStatus.SUCCESS; } } return state; } /** * whether complement end * * @return Boolean whether s complement end */ prvate boolean sComplementEnd() { f (!processInstance.sComplementData()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return true; } try { Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); Date endTme = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); return processInstance.getScheduleTme().equals(endTme); } catch (Excepton e) { logger.error("complement end faled ", e); return false; } } /** * updateProcessInstance process nstance state * after each batch of tasks s executed, the status of the process nstance s updated */ prvate vod updateProcessInstanceState() { ExecutonStatus state = getProcessInstanceState(processInstance); f (processInstance.getState() != state) { logger.nfo( "work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}", processInstance.getId(), processInstance.getName(), processInstance.getState(), state, processInstance.getCommandType()); processInstance.setState(state); f (state.typeIsFnshed()) { processInstance.setEndTme(new Date()); } processServce.updateProcessInstance(processInstance); StateEvent stateEvent = new StateEvent(); stateEvent.setExecutonStatus(processInstance.getState());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE); ths.processStateChangeHandler(stateEvent); } } /** * stateEvent's executon status as process nstance state */ prvate vod updateProcessInstanceState(StateEvent stateEvent) { ExecutonStatus state = stateEvent.getExecutonStatus(); f (processInstance.getState() != state) { logger.nfo( "work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}", processInstance.getId(), processInstance.getName(), processInstance.getState(), state, processInstance.getCommandType()); processInstance.setState(state); f (state.typeIsFnshed()) { processInstance.setEndTme(new Date()); } processServce.updateProcessInstance(processInstance); } } /** * get task dependency result * * @param taskInstance task nstance * @return DependResult */ prvate DependResult getDependResultForTask(TaskInstance taskInstance) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return sTaskDepsComplete(Long.toStrng(taskInstance.getTaskCode())); } /** * add task to standby lst * * @param taskInstance task nstance */ prvate vod addTaskToStandByLst(TaskInstance taskInstance) { try { f (readyToSubmtTaskQueue.contans(taskInstance)) { logger.warn("task was found n ready submt queue, task code:{}", taskInstance.getTaskCode()); return; } // need to boolean actve = hadNotFalTask(taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson()); f (actve) { logger.warn("task was found n actve task lst, task code:{}", taskInstance.getTaskCode()); return; } logger.nfo("add task to stand by lst, task name:{}, task d:{}, task code:{}", taskInstance.getName(), taskInstance.getId(), taskInstance.getTaskCode()); readyToSubmtTaskQueue.put(taskInstance); } catch (Excepton e) { logger.error("add task nstance to readyToSubmtTaskQueue, taskName:{}, task d:{}", taskInstance.getName(), taskInstance.getId(), e); } } /** * remove task from stand by lst * * @param taskInstance task nstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
*/ prvate vod removeTaskFromStandbyLst(TaskInstance taskInstance) { logger.nfo("remove task from stand by lst, d: {} name:{}", taskInstance.getId(), taskInstance.getName()); try { readyToSubmtTaskQueue.remove(taskInstance); } catch (Excepton e) { logger.error("remove task nstance from readyToSubmtTaskQueue error, task d:{}, Name: {}", taskInstance.getId(), taskInstance.getName(), e); } } /** * has retry task n standby * * @return Boolean whether has retry task n standby */ prvate boolean hasRetryTaskInStandBy() { for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) { f (ter.next().getState().typeIsFalure()) { return true; } } return false; } /** * close the on gong tasks */ prvate vod kllAllTasks() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.nfo("kll called on process nstance d: {}, num: {}", processInstance.getId(), actveTaskProcessorMaps.sze()); f (readyToSubmtTaskQueue.sze() > 0) { readyToSubmtTaskQueue.clear(); } for (long taskCode : actveTaskProcessorMaps.keySet()) { ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskCode); Integer taskInstanceId = valdTaskMap.get(taskCode); f (taskInstanceId == null || taskInstanceId.equals(0)) { contnue; } TaskInstance taskInstance = processServce.fndTaskInstanceById(taskInstanceId); f (taskInstance == null || taskInstance.getState().typeIsFnshed()) { contnue; } taskProcessor.acton(TaskActon.STOP); f (taskProcessor.taskInstance().getState().typeIsFnshed()) { StateEvent stateEvent = new StateEvent(); stateEvent.setType(StateEventType.TASK_STATE_CHANGE); stateEvent.setProcessInstanceId(ths.processInstance.getId()); stateEvent.setTaskInstanceId(taskInstance.getId()); stateEvent.setExecutonStatus(taskProcessor.taskInstance().getState()); ths.addStateEvent(stateEvent); } } } publc boolean workFlowFnsh() { return ths.processInstance.getState().typeIsFnshed(); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* handlng the lst of tasks to be submtted */ prvate vod submtStandByTask() { try { nt length = readyToSubmtTaskQueue.sze(); for (nt = 0; < length; ++) { TaskInstance task = readyToSubmtTaskQueue.peek(); f (task == null) { contnue; } // stop ta f (task.taskCanRetry()) { TaskInstance retryTask = processServce.fndTaskInstanceById(task.getId()); f (retryTask != null && retryTask.getState().equals(ExecutonStatus.FORCED_SUCCESS)) { task.setState(retryTask.getState()); logger.nfo("task: {} has been forced success, put t nto complete task lst and stop retryng", task.getName()); removeTaskFromStandbyLst(task); completeTaskMap.put(task.getTaskCode(), task.getId()); taskInstanceMap.put(task.getId(), task); submtPostNode(Long.toStrng(task.getTaskCode())); contnue; } } //nt var f (task.sFrstRun()) { //get pre Set<Strng> preTask = dag.getPrevousNodes(Long.toStrng(task.getTaskCode())); getPreVarPool(task, preTask); } DependResult dependResult = getDependResultForTask(task);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (DependResult.SUCCESS == dependResult) { TaskInstance taskInstance = submtTaskExec(task); f (taskInstance == null) { ths.taskFaledSubmt = true; } else { removeTaskFromStandbyLst(task); } } else f (DependResult.FAILED == dependResult) { // f the dependFaledTaskMap.put(task.getTaskCode(), task.getId()); removeTaskFromStandbyLst(task); logger.nfo("task {},d:{} depend result : {}", task.getName(), task.getId(), dependResult); } else f (DependResult.NON_EXEC == dependResult) { // for som removeTaskFromStandbyLst(task); logger.nfo("remove task {},d:{} , because depend result : {}", task.getName(), task.getId(), dependResult); } } } catch (Excepton e) { logger.error("submt standby task error", e); } } /** * get recovery task nstance lst * * @param taskIdArray task d array * @return recovery task nstance lst */ prvate Lst<TaskInstance> getRecoverTaskInstanceLst(Strng[] taskIdArray) { f (taskIdArray == null || taskIdArray.length == 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return new ArrayLst<>(); } Lst<Integer> taskIdLst = new ArrayLst<>(taskIdArray.length); for (Strng taskId : taskIdArray) { try { Integer d = Integer.valueOf(taskId); taskIdLst.add(d); } catch (Excepton e) { logger.error("get recovery task nstance faled ", e); } } return processServce.fndTaskInstanceByIdLst(taskIdLst); } /** * get start task nstance lst * * @param cmdParam command param * @return task nstance lst */ prvate Lst<TaskInstance> getStartTaskInstanceLst(Strng cmdParam) { Lst<TaskInstance> nstanceLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap != null && paramMap.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) { Strng[] dLst = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).splt(Constants.COMMA); nstanceLst = getRecoverTaskInstanceLst(dLst); } return nstanceLst; } /** * parse "StartNodeNameLst" from cmd param
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* * @param cmdParam command param * @return start node name lst */ prvate Lst<Strng> parseStartNodeName(Strng cmdParam) { Lst<Strng> startNodeNameLst = new ArrayLst<>(); Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam); f (paramMap == null) { return startNodeNameLst; } f (paramMap.contansKey(CMD_PARAM_START_NODES)) { startNodeNameLst = Arrays.asLst(paramMap.get(CMD_PARAM_START_NODES).splt(Constants.COMMA)); } return startNodeNameLst; } /** * generate start node code lst from parsng command param; * f "StartNodeIdLst" exsts n command param, return StartNodeIdLst * * @return recovery node code lst */ prvate Lst<Strng> getRecoveryNodeCodeLst(Lst<TaskInstance> recoverNodeLst) { Lst<Strng> recoveryNodeCodeLst = new ArrayLst<>(); f (CollectonUtls.sNotEmpty(recoverNodeLst)) { for (TaskInstance task : recoverNodeLst) { recoveryNodeCodeLst.add(Long.toStrng(task.getTaskCode())); } } return recoveryNodeCodeLst; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * generate flow dag * * @param totalTaskNodeLst total task node lst * @param startNodeNameLst start node name lst * @param recoveryNodeCodeLst recovery node code lst * @param depNodeType depend node type * @return ProcessDag process dag * @throws Excepton excepton */ publc ProcessDag generateFlowDag(Lst<TaskNode> totalTaskNodeLst, Lst<Strng> startNodeNameLst, Lst<Strng> recoveryNodeCodeLst, TaskDependType depNodeType) throws Excepton { return DagHelper.generateFlowDag(totalTaskNodeLst, startNodeNameLst, recoveryNodeCodeLst, depNodeType); } /** * check task queue */ prvate boolean checkTaskQueue() { AtomcBoolean result = new AtomcBoolean(false); taskInstanceMap.forEach((d, taskInstance) -> { f (taskInstance != null && taskInstance.getTaskGroupId() > 0) { result.set(true); } }); return result.get(); } /** * s new process nstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,065
[Bug] [Master] When there is only one task and the submit failed, the state of Process Instance is Incorrect
### 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 BG : The Process Instance have only one task In the method of `submitPostNode`, the task successfully added to `readyToSubmitTaskQueue`, then submit task from queue, if submit failed, such as DB error, the `taskFailedSubmit` is true and `readyToSubmitTaskQueue` size is not empty. when execute the method of `updateProcessInstanceState`, case one: FailureStrategy is END, it return state of `FAILURE`, and update state; case two: FailureStrategy is CONTINUE, it return state of `RUNNING_EXECUTION`, and remain the same state forever; More seriously, both cases will cause `processInstanceExecCacheManager` not remove `WorkflowExecuteThread` ![image](https://user-images.githubusercontent.com/29919212/159254253-7d306b96-3a26-4b40-9fd7-1875a4404dec.png) ![image](https://user-images.githubusercontent.com/29919212/159262647-67b8351f-8073-4de3-8e60-dfe9e4c53d2a.png) ### What you expected to happen the process instance can update the state normally and can terminate normally. I hope it will be resolved in v2.0.6 ### How to reproduce Refer to `What happened` ### 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/9065
https://github.com/apache/dolphinscheduler/pull/9186
6b2a4e31eadf707272381ced26a81eaa557e60c0
3e5781b6e1c38675ba134048b21941be63723cb6
2022-03-21T12:46:10Z
java
2022-04-01T14:23:35Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
*/ prvate boolean sNewProcessInstance() { f (ExecutonStatus.RUNNING_EXECUTION == processInstance.getState() && processInstance.getRunTmes() == 1) { return true; } else { return false; } } /** * check f had not fal task by taskCode and verson * * @param taskCode * @param verson * @return */ prvate boolean hadNotFalTask(long taskCode, nt verson) { boolean result = false; for (Entry<Integer, TaskInstance> entry : taskInstanceMap.entrySet()) { TaskInstance taskInstance = entry.getValue(); f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == verson) { f (!taskInstance.getState().typeIsFalure()) { result = true; break; } } } return result; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.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
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.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.alert; import org.apache.dolphinscheduler.alert.api.AlertChannel; import org.apache.dolphinscheduler.alert.api.AlertConstants; import org.apache.dolphinscheduler.alert.api.AlertData; import org.apache.dolphinscheduler.alert.api.AlertInfo; import org.apache.dolphinscheduler.alert.api.AlertResult; import org.apache.dolphinscheduler.common.enums.AlertStatus; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.dao.entity.Alert; import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance; import org.apache.dolphinscheduler.remote.command.alert.AlertSendResponseCommand; import org.apache.dolphinscheduler.remote.command.alert.AlertSendResponseResult; import org.apache.commons.collections.CollectionUtils; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @Component public final class AlertSender {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.java
private static final Logger logger = LoggerFactory.getLogger(AlertSender.class); private final AlertDao alertDao; private final AlertPluginManager alertPluginManager; public AlertSender(AlertDao alertDao, AlertPluginManager alertPluginManager) { this.alertDao = alertDao; this.alertPluginManager = alertPluginManager; } public void send(List<Alert> alerts) { for (Alert alert : alerts) { int alertGroupId = alert.getAlertGroupId(); List<AlertPluginInstance> alertInstanceList = alertDao.listInstanceByAlertGroupId(alertGroupId); if (CollectionUtils.isEmpty(alertInstanceList)) { logger.error("send alert msg fail,no bind plugin instance."); alertDao.updateAlert(AlertStatus.EXECUTION_FAILURE, "no bind plugin instance", alert.getId()); continue; } AlertData alertData = new AlertData(); alertData.setId(alert.getId()) .setContent(alert.getContent()) .setLog(alert.getLog()) .setTitle(alert.getTitle()) .setTitle(alert.getTitle()) .setWarnType(alert.getWarningType().getCode()); for (AlertPluginInstance instance : alertInstanceList) { AlertResult alertResult = this.alertResultHandler(instance, alertData); if (alertResult != null) { AlertStatus alertStatus = Boolean.parseBoolean(String.valueOf(alertResult.getStatus())) ? AlertStatus.EXECUTION_SUCCESS : AlertStatus.EXECUTION_FAILURE; alertDao.updateAlert(alertStatus, alertResult.getMessage(), alert.getId()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.java
} } } /** * sync send alert handler * * @param alertGroupId alertGroupId * @param title title * @param content content * @return AlertSendResponseCommand */ public AlertSendResponseCommand syncHandler(int alertGroupId, String title, String content , int warnType) { List<AlertPluginInstance> alertInstanceList = alertDao.listInstanceByAlertGroupId(alertGroupId); AlertData alertData = new AlertData(); alertData.setContent(content) .setTitle(title) .setWarnType(warnType); boolean sendResponseStatus = true; List<AlertSendResponseResult> sendResponseResults = new ArrayList<>(); if (CollectionUtils.isEmpty(alertInstanceList)) { AlertSendResponseResult alertSendResponseResult = new AlertSendResponseResult(); String message = String.format("Alert GroupId %s send error : not found alert instance", alertGroupId); alertSendResponseResult.setStatus(false); alertSendResponseResult.setMessage(message); sendResponseResults.add(alertSendResponseResult); logger.error("Alert GroupId {} send error : not found alert instance", alertGroupId); return new AlertSendResponseCommand(false, sendResponseResults); } for (AlertPluginInstance instance : alertInstanceList) { AlertResult alertResult = this.alertResultHandler(instance, alertData);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.java
if (alertResult != null) { AlertSendResponseResult alertSendResponseResult = new AlertSendResponseResult( Boolean.parseBoolean(String.valueOf(alertResult.getStatus())), alertResult.getMessage()); sendResponseStatus = sendResponseStatus && alertSendResponseResult.getStatus(); sendResponseResults.add(alertSendResponseResult); } } return new AlertSendResponseCommand(sendResponseStatus, sendResponseResults); } /** * alert result handler * * @param instance instance * @param alertData alertData * @return AlertResult */ private AlertResult alertResultHandler(AlertPluginInstance instance, AlertData alertData) { Optional<AlertChannel> alertChannel = alertPluginManager.getAlertChannel(instance.getPluginDefineId()); AlertResult alertResultExtend = new AlertResult(); String pluginInstanceName = instance.getInstanceName(); if (!alertChannel.isPresent()) { String message = String.format("Alert Plugin %s send error : return value is null", pluginInstanceName); alertResultExtend.setStatus(String.valueOf(false)); alertResultExtend.setMessage(message); logger.error("Alert Plugin {} send error : not found plugin {}", pluginInstanceName, instance.getPluginDefineId()); return alertResultExtend; } Map<String, String> paramsMap = JSONUtils.toMap(instance.getPluginInstanceParams()); String instanceWarnType = WarningType.ALL.getDescp(); if(paramsMap != null){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.java
instanceWarnType = paramsMap.getOrDefault(AlertConstants.NAME_WARNING_TYPE, WarningType.ALL.getDescp()); } WarningType warningType = WarningType.of(instanceWarnType); if (warningType == null) { String message = String.format("Alert Plugin %s send error : plugin warnType is null", pluginInstanceName); alertResultExtend.setStatus(String.valueOf(false)); alertResultExtend.setMessage(message); logger.error("Alert Plugin {} send error : plugin warnType is null", pluginInstanceName); return alertResultExtend; } boolean sendWarning = false; switch (warningType) { case ALL: sendWarning = true; break; case SUCCESS: if (alertData.getWarnType() == WarningType.SUCCESS.getCode()) { sendWarning = true; } break; case FAILURE: if (alertData.getWarnType() == WarningType.FAILURE.getCode()) { sendWarning = true; } break; default: } if (!sendWarning) { logger.info("Alert Plugin {} send ignore warning type not match: plugin warning type is {}, alert data warning type is {}", pluginInstanceName, warningType.getCode(), alertData.getWarnType()); return null;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertSender.java
} AlertInfo alertInfo = new AlertInfo(); alertInfo.setAlertData(alertData); alertInfo.setAlertParams(paramsMap); AlertResult alertResult; try { alertResult = alertChannel.get().process(alertInfo); } catch (Exception e) { alertResult = new AlertResult("false", e.getMessage()); logger.error("send alert error alert data id :{},", alertData.getId(), e); } if (alertResult == null) { String message = String.format("Alert Plugin %s send error : return alertResult value is null", pluginInstanceName); alertResultExtend.setStatus(String.valueOf(false)); alertResultExtend.setMessage(message); logger.info("Alert Plugin {} send error : return alertResult value is null", pluginInstanceName); } else if (!Boolean.parseBoolean(String.valueOf(alertResult.getStatus()))) { alertResultExtend.setStatus(String.valueOf(false)); alertResultExtend.setMessage(alertResult.getMessage()); logger.info("Alert Plugin {} send error : {}", pluginInstanceName, alertResult.getMessage()); } else { String message = String.format("Alert Plugin %s send success", pluginInstanceName); alertResultExtend.setStatus(String.valueOf(true)); alertResultExtend.setMessage(message); logger.info("Alert Plugin {} send success", pluginInstanceName); } return alertResultExtend; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.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
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.java
* See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; /** * alert status */ public enum AlertStatus { /** * 0 waiting executed; 1 execute successfully,2 execute failed */ WAIT_EXECUTION(0, "waiting executed"), EXECUTION_SUCCESS(1, "execute successfully"), EXECUTION_FAILURE(2, "execute failed"); AlertStatus(int code, String descp) { this.code = code; this.descp = descp; } @EnumValue private final int code; private final String descp; public int getCode() { return code; } public String getDescp() { return descp; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.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,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.dao; import org.apache.dolphinscheduler.common.enums.AlertEvent; import org.apache.dolphinscheduler.common.enums.AlertStatus; import org.apache.dolphinscheduler.common.enums.AlertWarnLevel; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.Alert; import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance; import org.apache.dolphinscheduler.dao.entity.ProcessAlertContent; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.ServerAlertContent; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper; import org.apache.dolphinscheduler.dao.mapper.AlertMapper; import org.apache.dolphinscheduler.dao.mapper.AlertPluginInstanceMapper; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.google.common.collect.Lists; @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
public class AlertDao { @Autowired private AlertMapper alertMapper; @Autowired private AlertPluginInstanceMapper alertPluginInstanceMapper; @Autowired private AlertGroupMapper alertGroupMapper; /** * insert alert * * @param alert alert * @return add alert result */ public int addAlert(Alert alert) { return alertMapper.insert(alert); } /** * update alert * * @param alertStatus alertStatus
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
* @param log log * @param id id * @return update alert result */ public int updateAlert(AlertStatus alertStatus, String log, int id) { Alert alert = alertMapper.selectById(id); alert.setAlertStatus(alertStatus); alert.setUpdateTime(new Date()); alert.setLog(log); return alertMapper.updateById(alert); } /** * MasterServer or WorkerServer stoped * * @param alertGroupId alertGroupId * @param host host * @param serverType serverType */ public void sendServerStopedAlert(int alertGroupId, String host, String serverType) { ServerAlertContent serverStopAlertContent = ServerAlertContent.newBuilder(). type(serverType) .host(host) .event(AlertEvent.SERVER_DOWN) .warningLevel(AlertWarnLevel.SERIOUS). build(); String content = JSONUtils.toJsonString(Lists.newArrayList(serverStopAlertContent)); Alert alert = new Alert(); alert.setTitle("Fault tolerance warning"); alert.setWarningType(WarningType.FAILURE); alert.setAlertStatus(AlertStatus.WAIT_EXECUTION);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
alert.setContent(content); alert.setAlertGroupId(alertGroupId); alert.setCreateTime(new Date()); alert.setUpdateTime(new Date()); alertMapper.insertAlertWhenServerCrash(alert); } /** * process time out alert * * @param processInstance processInstance * @param projectUser projectUser */ public void sendProcessTimeoutAlert(ProcessInstance processInstance, ProjectUser projectUser) { int alertGroupId = processInstance.getWarningGroupId(); Alert alert = new Alert(); List<ProcessAlertContent> processAlertContentList = new ArrayList<>(1); ProcessAlertContent processAlertContent = ProcessAlertContent.newBuilder() .projectCode(projectUser.getProjectCode()) .projectName(projectUser.getProjectName()) .owner(projectUser.getUserName()) .processId(processInstance.getId()) .processDefinitionCode(processInstance.getProcessDefinitionCode()) .processName(processInstance.getName()) .processType(processInstance.getCommandType()) .processState(processInstance.getState()) .runTimes(processInstance.getRunTimes()) .processStartTime(processInstance.getStartTime()) .processHost(processInstance.getHost()) .event(AlertEvent.TIME_OUT)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
.warningLevel(AlertWarnLevel.MIDDLE) .build(); processAlertContentList.add(processAlertContent); String content = JSONUtils.toJsonString(processAlertContentList); alert.setTitle("Process Timeout Warn"); saveTaskTimeoutAlert(alert, content, alertGroupId); } private void saveTaskTimeoutAlert(Alert alert, String content, int alertGroupId) { alert.setAlertGroupId(alertGroupId); alert.setWarningType(WarningType.FAILURE); alert.setContent(content); alert.setCreateTime(new Date()); alert.setUpdateTime(new Date()); alertMapper.insert(alert); } /** * task timeout warn * * @param processInstance processInstanceId * @param taskInstance taskInstance * @param projectUser projectUser */ public void sendTaskTimeoutAlert(ProcessInstance processInstance, TaskInstance taskInstance, ProjectUser projectUser) { Alert alert = new Alert(); List<ProcessAlertContent> processAlertContentList = new ArrayList<>(1); ProcessAlertContent processAlertContent = ProcessAlertContent.newBuilder() .projectCode(projectUser.getProjectCode()) .projectName(projectUser.getProjectName()) .owner(projectUser.getUserName()) .processId(processInstance.getId())
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
.processDefinitionCode(processInstance.getProcessDefinitionCode()) .processName(processInstance.getName()) .taskCode(taskInstance.getTaskCode()) .taskName(taskInstance.getName()) .taskType(taskInstance.getTaskType()) .taskStartTime(taskInstance.getStartTime()) .taskHost(taskInstance.getHost()) .event(AlertEvent.TIME_OUT) .warningLevel(AlertWarnLevel.MIDDLE) .build(); processAlertContentList.add(processAlertContent); String content = JSONUtils.toJsonString(processAlertContentList); alert.setTitle("Task Timeout Warn"); saveTaskTimeoutAlert(alert, content, processInstance.getWarningGroupId()); } /** * List alerts that are pending for execution */ public List<Alert> listPendingAlerts() { return alertMapper.listAlertByStatus(AlertStatus.WAIT_EXECUTION); } /** * for test * * @return AlertMapper */ public AlertMapper getAlertMapper() { return alertMapper; } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java
* list all alert plugin instance by alert group id * * @param alertGroupId alert group id * @return AlertPluginInstance list */ public List<AlertPluginInstance> listInstanceByAlertGroupId(int alertGroupId) { String alertInstanceIdsParam = alertGroupMapper.queryAlertGroupInstanceIdsById(alertGroupId); if (StringUtils.isNotBlank(alertInstanceIdsParam)) { String[] idsArray = alertInstanceIdsParam.split(","); List<Integer> ids = Arrays.stream(idsArray) .map(s -> Integer.parseInt(s.trim())) .collect(Collectors.toList()); return alertPluginInstanceMapper.queryByIds(ids); } return null; } public AlertPluginInstanceMapper getAlertPluginInstanceMapper() { return alertPluginInstanceMapper; } public void setAlertPluginInstanceMapper(AlertPluginInstanceMapper alertPluginInstanceMapper) { this.alertPluginInstanceMapper = alertPluginInstanceMapper; } public AlertGroupMapper getAlertGroupMapper() { return alertGroupMapper; } public void setAlertGroupMapper(AlertGroupMapper alertGroupMapper) { this.alertGroupMapper = alertGroupMapper; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/AlertDaoTest.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
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/AlertDaoTest.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.dao; import org.apache.dolphinscheduler.common.enums.AlertStatus; import org.apache.dolphinscheduler.common.enums.ProfileType; import org.apache.dolphinscheduler.dao.entity.Alert; import java.util.List; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; @ActiveProfiles(ProfileType.H2) @RunWith(SpringRunner.class) @SpringBootApplication(scanBasePackageClasses = DaoConfiguration.class) @SpringBootTest(classes = DaoConfiguration.class) @Transactional @Rollback @EnableTransactionManagement public class AlertDaoTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,204
[Feature][alert] add AlertStatus entity
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Alert and AlertPluginInstance are 1:N. The alert status will be updated after the alert is sent. Sending to multiple AlertPluginInstances will cause the alarm status to overwrite each other. Add AlertStatus entity. Each time the transmission is successful, an alarm status is added. The status in the alert: all success, partial success, all failure. AlertStatus is the detail. include: alertId, alertPluginInstanceId, status, statusMessage. ### Use case the alert status is more accurate and detailed ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9204
https://github.com/apache/dolphinscheduler/pull/9208
ce7740b9fc7705c7188e019a2ee8cb0feef06629
2bab12f2c855e9d4421d081518b53a088f0969ce
2022-03-26T10:39:11Z
java
2022-04-06T10:08:00Z
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/AlertDaoTest.java
@Autowired private AlertDao alertDao; @Test public void testAlertDao() { Alert alert = new Alert(); alert.setTitle("Mysql Exception"); alert.setContent("[\"alarm time:2018-02-05\", \"service name:MYSQL_ALTER\", \"alarm name:MYSQL_ALTER_DUMP\", " + "\"get the alarm exception.!,interface error,exception information:timed out\", \"request address:http://blog.csdn.net/dreamInTheWorld/article/details/78539286\"]"); alert.setAlertGroupId(1); alert.setAlertStatus(AlertStatus.WAIT_EXECUTION); alertDao.addAlert(alert); List<Alert> alerts = alertDao.listPendingAlerts(); Assert.assertNotNull(alerts); Assert.assertNotEquals(0, alerts.size()); } @Test public void testSendServerStopedAlert() { int alertGroupId = 1; String host = "127.0.0.998165432"; String serverType = "Master"; alertDao.sendServerStopedAlert(alertGroupId, host, serverType); alertDao.sendServerStopedAlert(alertGroupId, host, serverType); long count = alertDao.listPendingAlerts() .stream() .filter(alert -> alert.getContent().contains(host)) .count(); Assert.assertEquals(1L, count); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.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
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
* See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.api.controller; import static org.apache.dolphinscheduler.api.enums.Status.CHECK_PROCESS_DEFINITION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.EXECUTE_PROCESS_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.START_PROCESS_INSTANCE_ERROR; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.ExecuteType; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ExecutorService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.ComplementDependentMode; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.enums.RunMode; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import springfox.documentation.annotations.ApiIgnore; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * executor controller */ @Api(tags = "EXECUTOR_TAG") @RestController @RequestMapping("projects/{projectCode}/executors") public class ExecutorController extends BaseController { @Autowired private ExecutorService execService; /** * execute process instance * * @param loginUser login user * @param projectCode project code * @param processDefinitionCode process definition code * @param scheduleTime schedule time
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
* @param failureStrategy failure strategy * @param startNodeList start nodes list * @param taskDependType task depend type * @param execType execute type * @param warningType warning type * @param warningGroupId warning group id * @param runMode run mode * @param processInstancePriority process instance priority * @param workerGroup worker group * @param timeout timeout * @param expectedParallelismNumber the expected parallelism number when execute complement in parallel mode * @return start process result code */ @ApiOperation(value = "startProcessInstance", notes = "RUN_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100"), @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", dataType = "String"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"), @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType = "String"), @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType = "TaskDependType"), @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType = "CommandType"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", required = true, dataType = "WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataType = "Int", example = "100"), @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType = "RunMode"), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"), @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataType = "String", example = "default"), @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long", example = "-1"), @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int", example = "100"), @ApiImplicitParam(name = "expectedParallelismNumber", value = "EXPECTED_PARALLELISM_NUMBER", dataType = "Int" , example = "8"), @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType = "Int", example = "0"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
@ApiImplicitParam(name = "complementDependentMode", value = "COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode") }) @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") long processDefinitionCode, @RequestParam(value = "scheduleTime", required = false) String scheduleTime, @RequestParam(value = "failureStrategy") FailureStrategy failureStrategy, @RequestParam(value = "startNodeList", required = false) String startNodeList, @RequestParam(value = "taskDependType", required = false) TaskDependType taskDependType, @RequestParam(value = "execType", required = false) CommandType execType, @RequestParam(value = "warningType") WarningType warningType, @RequestParam(value = "warningGroupId", required = false, defaultValue = "0") Integer warningGroupId, @RequestParam(value = "runMode", required = false) RunMode runMode, @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority, @RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, @RequestParam(value = "environmentCode", required = false, defaultValue = "-1") Long environmentCode, @RequestParam(value = "timeout", required = false) Integer timeout, @RequestParam(value = "startParams", required = false) String startParams, @RequestParam(value = "expectedParallelismNumber", required = false) Integer expectedParallelismNumber, @RequestParam(value = "dryRun", defaultValue = "0", required = false) int dryRun, @RequestParam(value = "complementDependentMode", required = false) ComplementDependentMode complementDependentMode) { if (timeout == null) { timeout = Constants.MAX_TASK_TIMEOUT; } Map<String, String> startParamMap = null; if (startParams != null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
startParamMap = JSONUtils.toMap(startParams); } if (complementDependentMode == null) { complementDependentMode = ComplementDependentMode.OFF_MODE; } Map<String, Object> result = execService.execProcessInstance(loginUser, projectCode, processDefinitionCode, scheduleTime, execType, failureStrategy, startNodeList, taskDependType, warningType, warningGroupId, runMode, processInstancePriority, workerGroup, environmentCode, timeout, startParamMap, expectedParallelismNumber, dryRun, complementDependentMode); return returnDataList(result); } /** * batch execute process instance * If any processDefinitionCode cannot be found, the failure information is returned and the status is set to * failed. The successful task will run normally and will not stop * * @param loginUser login user * @param projectCode project code * @param processDefinitionCodes process definition codes * @param scheduleTime schedule time * @param failureStrategy failure strategy * @param startNodeList start nodes list * @param taskDependType task depend type * @param execType execute type * @param warningType warning type * @param warningGroupId warning group id * @param runMode run mode * @param processInstancePriority process instance priority * @param workerGroup worker group * @param timeout timeout
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
* @param expectedParallelismNumber the expected parallelism number when execute complement in parallel mode * @return start process result code */ @ApiOperation(value = "batchStartProcessInstance", notes = "BATCH_RUN_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionCodes", value = "PROCESS_DEFINITION_CODES", required = true, dataType = "String", example = "1,2,3"), @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", required = true, dataType = "String"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"), @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType = "String"), @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType = "TaskDependType"), @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType = "CommandType"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", required = true, dataType = "WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType = "RunMode"), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"), @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataType = "String", example = "default"), @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long", example = "-1"), @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int", example = "100"), @ApiImplicitParam(name = "expectedParallelismNumber", value = "EXPECTED_PARALLELISM_NUMBER", dataType = "Int", example = "8"), @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType = "Int", example = "0"), @ApiImplicitParam(name = "complementDependentMode", value = "COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode") }) @PostMapping(value = "batch-start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result batchStartProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCodes") String processDefinitionCodes, @RequestParam(value = "scheduleTime", required = false) String scheduleTime,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
@RequestParam(value = "failureStrategy") FailureStrategy failureStrategy, @RequestParam(value = "startNodeList", required = false) String startNodeList, @RequestParam(value = "taskDependType", required = false) TaskDependType taskDependType, @RequestParam(value = "execType", required = false) CommandType execType, @RequestParam(value = "warningType") WarningType warningType, @RequestParam(value = "warningGroupId", required = false) int warningGroupId, @RequestParam(value = "runMode", required = false) RunMode runMode, @RequestParam(value = "processInstancePriority", required = false) Priority processInstancePriority, @RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, @RequestParam(value = "environmentCode", required = false, defaultValue = "-1") Long environmentCode, @RequestParam(value = "timeout", required = false) Integer timeout, @RequestParam(value = "startParams", required = false) String startParams, @RequestParam(value = "expectedParallelismNumber", required = false) Integer expectedParallelismNumber, @RequestParam(value = "dryRun", defaultValue = "0", required = false) int dryRun, @RequestParam(value = "complementDependentMode", required = false) ComplementDependentMode complementDependentMode) { if (timeout == null) { timeout = Constants.MAX_TASK_TIMEOUT; } Map<String, String> startParamMap = null; if (startParams != null) { startParamMap = JSONUtils.toMap(startParams); } if (complementDependentMode == null) { complementDependentMode = ComplementDependentMode.OFF_MODE; } Map<String, Object> result = new HashMap<>(); List<String> processDefinitionCodeArray = Arrays.asList(processDefinitionCodes.split(Constants.COMMA)); List<String> startFailedProcessDefinitionCodeList = new ArrayList<>(); processDefinitionCodeArray = processDefinitionCodeArray.stream().distinct().collect(Collectors.toList()); for (String strProcessDefinitionCode : processDefinitionCodeArray) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
long processDefinitionCode = Long.parseLong(strProcessDefinitionCode); result = execService.execProcessInstance(loginUser, projectCode, processDefinitionCode, scheduleTime, execType, failureStrategy, startNodeList, taskDependType, warningType, warningGroupId, runMode, processInstancePriority, workerGroup, environmentCode, timeout, startParamMap, expectedParallelismNumber, dryRun, complementDependentMode); if (!Status.SUCCESS.equals(result.get(Constants.STATUS))) { startFailedProcessDefinitionCodeList.add(String.valueOf(processDefinitionCode)); } } if (!startFailedProcessDefinitionCodeList.isEmpty()) { putMsg(result, Status.BATCH_START_PROCESS_INSTANCE_ERROR, String.join(Constants.COMMA, startFailedProcessDefinitionCodeList)); } return returnDataList(result); } /** * do action to process instance:pause, stop, repeat, recover from pause, recover from stop * * @param loginUser login user * @param projectCode project code * @param processInstanceId process instance id * @param executeType execute type * @return execute result code */ @ApiOperation(value = "execute", notes = "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE", required = true, dataType = "ExecuteType") }) @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
@ApiException(EXECUTE_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("processInstanceId") Integer processInstanceId, @RequestParam("executeType") ExecuteType executeType ) { Map<String, Object> result = execService.execute(loginUser, projectCode, processInstanceId, executeType); return returnDataList(result); } /** * check process definition and all the son process definitions is online. * * @param processDefinitionCode process definition code * @return check result code */ @ApiOperation(value = "startCheckProcessDefinition", notes = "START_CHECK_PROCESS_DEFINITION_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100") }) @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) @ApiException(CHECK_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result startCheckProcessDefinition(@RequestParam(value = "processDefinitionCode") long processDefinitionCode) { Map<String, Object> result = execService.startCheckByProcessDefinedCode(processDefinitionCode); return returnDataList(result); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.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
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
*/ package org.apache.dolphinscheduler.api.controller; import com.google.common.collect.ImmutableMap; import com.google.gson.Gson; import com.google.gson.JsonObject; import org.apache.dolphinscheduler.api.enums.ExecuteType; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.ExecutorService; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.*; import org.apache.dolphinscheduler.dao.entity.User; import org.junit.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * executor controller test */ public class ExecutorControllerTest extends AbstractControllerTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
final Gson gson = new Gson(); final long projectCode = 1L; final long processDefinitionCode = 2L; final String scheduleTime = "scheduleTime"; final FailureStrategy failureStrategy = FailureStrategy.END; final String startNodeList = "startNodeList"; final TaskDependType taskDependType = TaskDependType.TASK_ONLY; final CommandType execType = CommandType.PAUSE; final WarningType warningType = WarningType.NONE; final int warningGroupId = 3; final RunMode runMode = RunMode.RUN_MODE_SERIAL; final Priority processInstancePriority = Priority.HIGH; final String workerGroup = "workerGroup"; final Long environmentCode = 4L; final Integer timeout = 5; final ImmutableMap<String, String> startParams = ImmutableMap.of("start", "params"); final Integer expectedParallelismNumber = 6; final int dryRun = 7; final ComplementDependentMode complementDependentMode = ComplementDependentMode.OFF_MODE; final JsonObject expectResponseContent = gson .fromJson("{\"code\":0,\"msg\":\"success\",\"data\":\"Test Data\",\"success\":true,\"failed\":false}" , JsonObject.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
final ImmutableMap<String, Object> executeServiceResult = ImmutableMap.of(Constants.STATUS, Status.SUCCESS, Constants.DATA_LIST, "Test Data"); @MockBean(name = "executorServiceImpl") private ExecutorService executorService; @Test public void testStartProcessInstanceWithFullParams() throws Exception { final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("processDefinitionCode", String.valueOf(processDefinitionCode)); paramsMap.add("scheduleTime", scheduleTime); paramsMap.add("failureStrategy", String.valueOf(failureStrategy)); paramsMap.add("startNodeList", startNodeList); paramsMap.add("taskDependType", String.valueOf(taskDependType)); paramsMap.add("execType", String.valueOf(execType)); paramsMap.add("warningType", String.valueOf(warningType)); paramsMap.add("warningGroupId", String.valueOf(warningGroupId)); paramsMap.add("runMode", String.valueOf(runMode)); paramsMap.add("processInstancePriority", String.valueOf(processInstancePriority)); paramsMap.add("workerGroup", workerGroup); paramsMap.add("environmentCode", String.valueOf(environmentCode)); paramsMap.add("timeout", String.valueOf(timeout)); paramsMap.add("startParams", gson.toJson(startParams)); paramsMap.add("expectedParallelismNumber", String.valueOf(expectedParallelismNumber)); paramsMap.add("dryRun", String.valueOf(dryRun)); when(executorService.execProcessInstance(any(User.class), eq(projectCode), eq(processDefinitionCode), eq(scheduleTime), eq(execType), eq(failureStrategy), eq(startNodeList), eq(taskDependType), eq(warningType), eq(warningGroupId), eq(runMode), eq(processInstancePriority), eq(workerGroup), eq(environmentCode), eq(timeout), eq(startParams), eq(expectedParallelismNumber), eq(dryRun), eq(complementDependentMode))) .thenReturn(executeServiceResult);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/start-process-instance", projectCode) .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } @Test public void testStartProcessInstanceWithoutTimeout() throws Exception { final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("processDefinitionCode", String.valueOf(processDefinitionCode)); paramsMap.add("scheduleTime", scheduleTime); paramsMap.add("failureStrategy", String.valueOf(failureStrategy)); paramsMap.add("startNodeList", startNodeList); paramsMap.add("taskDependType", String.valueOf(taskDependType)); paramsMap.add("execType", String.valueOf(execType)); paramsMap.add("warningType", String.valueOf(warningType)); paramsMap.add("warningGroupId", String.valueOf(warningGroupId)); paramsMap.add("runMode", String.valueOf(runMode)); paramsMap.add("processInstancePriority", String.valueOf(processInstancePriority)); paramsMap.add("workerGroup", workerGroup); paramsMap.add("environmentCode", String.valueOf(environmentCode)); paramsMap.add("startParams", gson.toJson(startParams)); paramsMap.add("expectedParallelismNumber", String.valueOf(expectedParallelismNumber)); paramsMap.add("dryRun", String.valueOf(dryRun));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
when(executorService.execProcessInstance(any(User.class), eq(projectCode), eq(processDefinitionCode), eq(scheduleTime), eq(execType), eq(failureStrategy), eq(startNodeList), eq(taskDependType), eq(warningType), eq(warningGroupId), eq(runMode), eq(processInstancePriority), eq(workerGroup), eq(environmentCode), eq(Constants.MAX_TASK_TIMEOUT), eq(startParams), eq(expectedParallelismNumber), eq(dryRun), eq(complementDependentMode))).thenReturn(executeServiceResult); final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/start-process-instance", projectCode) .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } @Test public void testStartProcessInstanceWithoutStartParams() throws Exception { final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("processDefinitionCode", String.valueOf(processDefinitionCode)); paramsMap.add("scheduleTime", scheduleTime); paramsMap.add("failureStrategy", String.valueOf(failureStrategy)); paramsMap.add("startNodeList", startNodeList); paramsMap.add("taskDependType", String.valueOf(taskDependType)); paramsMap.add("execType", String.valueOf(execType)); paramsMap.add("warningType", String.valueOf(warningType)); paramsMap.add("warningGroupId", String.valueOf(warningGroupId)); paramsMap.add("runMode", String.valueOf(runMode)); paramsMap.add("processInstancePriority", String.valueOf(processInstancePriority));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
paramsMap.add("workerGroup", workerGroup); paramsMap.add("environmentCode", String.valueOf(environmentCode)); paramsMap.add("timeout", String.valueOf(timeout)); paramsMap.add("expectedParallelismNumber", String.valueOf(expectedParallelismNumber)); paramsMap.add("dryRun", String.valueOf(dryRun)); when(executorService.execProcessInstance(any(User.class), eq(projectCode), eq(processDefinitionCode), eq(scheduleTime), eq(execType), eq(failureStrategy), eq(startNodeList), eq(taskDependType), eq(warningType), eq(warningGroupId), eq(runMode), eq(processInstancePriority), eq(workerGroup), eq(environmentCode), eq(timeout), eq(null), eq(expectedParallelismNumber), eq(dryRun), eq(complementDependentMode))).thenReturn(executeServiceResult); final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/start-process-instance", projectCode) .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } @Test public void testStartProcessInstanceWithRequiredParams() throws Exception { final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("processDefinitionCode", String.valueOf(processDefinitionCode)); paramsMap.add("failureStrategy", String.valueOf(failureStrategy)); paramsMap.add("warningType", String.valueOf(warningType)); when(executorService.execProcessInstance(any(User.class), eq(projectCode), eq(processDefinitionCode), eq(null), eq(null), eq(failureStrategy), eq(null), eq(null), eq(warningType),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
eq(0), eq(null), eq(null), eq("default"), eq(-1L), eq(Constants.MAX_TASK_TIMEOUT), eq(null), eq(null), eq(0), eq(complementDependentMode))).thenReturn(executeServiceResult); final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/start-process-instance", projectCode) .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } @Test public void testExecuteWithSuccessStatus() throws Exception { final ExecuteType executeType = ExecuteType.NONE; final int processInstanceId = 40; final long projectCode = 1113; final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); paramsMap.add("processInstanceId", Integer.toString(processInstanceId)); paramsMap.add("executeType", String.valueOf(executeType)); final Map<String, Object> executeServiceResult = new HashMap<>(); executeServiceResult.put(Constants.STATUS, Status.SUCCESS); executeServiceResult.put(Constants.DATA_LIST, "Test Data"); final JsonObject expectResponseContent = gson .fromJson("{\"code\":0,\"msg\":\"success\",\"data\":\"Test Data\",\"success\":true,\"failed\":false}" , JsonObject.class); when(executorService.execute(any(User.class), eq(projectCode), eq(processInstanceId), eq(ExecuteType.NONE)))
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,355
[Bug] [rest api] /dolphinscheduler/projects/{projectCode}/executors/start-process-instance
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened parameter scheduleTime is not required, but in page `http://{api server ip}:12345/dolphinscheduler/doc.html?language=zh_CN&lang=cn ` the start-process-instance api also show it is required, and not show what kind of value is validated, it is very confused, event if I give the wrong value, the api also respone sucess, but the process not run. ### What you expected to happen A clear api doc with some example for commonly use api. ### How to reproduce I'm using 2.0.5 the api doc is wrong. ### Anything else _No response_ ### Version 2.0.5 ### 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/9355
https://github.com/apache/dolphinscheduler/pull/9359
c294979e2fc96e876f5699bc3164accbfa5c1023
1679f15a50a505e5177ad659348dec9b1ef863f9
2022-04-06T01:46:20Z
java
2022-04-06T13:34:22Z
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
.thenReturn(executeServiceResult); final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/execute", projectCode) .header("sessionId", sessionId) .params(paramsMap)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } @Test public void testStartCheckProcessDefinition() throws Exception { when(executorService.startCheckByProcessDefinedCode(processDefinitionCode)) .thenReturn(executeServiceResult); final MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/executors/start-check", projectCode) .header(SESSION_ID, sessionId) .param("processDefinitionCode", String.valueOf(processDefinitionCode))) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andReturn(); final JsonObject actualResponseContent = gson.fromJson(mvcResult.getResponse().getContentAsString(), JsonObject.class); assertThat(actualResponseContent).isEqualTo(expectResponseContent); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertPluginManager.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 java.lang.String.format; import org.apache.dolphinscheduler.alert.api.AlertChannel; import org.apache.dolphinscheduler.alert.api.AlertChannelFactory; import org.apache.dolphinscheduler.alert.api.AlertConstants; import org.apache.dolphinscheduler.common.enums.PluginType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.dao.PluginDao; import org.apache.dolphinscheduler.dao.entity.PluginDefine; import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer; import org.apache.dolphinscheduler.spi.params.base.ParamsOptions; import org.apache.dolphinscheduler.spi.params.base.PluginParams; import org.apache.dolphinscheduler.spi.params.base.Validate; import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertPluginManager.java
import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.ServiceLoader; import java.util.Set; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; @Component public final class AlertPluginManager { private static final Logger logger = LoggerFactory.getLogger(AlertPluginManager.class); private final PluginDao pluginDao; private final Map<Integer, AlertChannel> channelKeyedById = new HashMap<>(); private final PluginParams warningTypeParams = getWarningTypeParams(); public AlertPluginManager(PluginDao pluginDao) { this.pluginDao = pluginDao; } public PluginParams getWarningTypeParams() { return RadioParam.newBuilder(AlertConstants.NAME_WARNING_TYPE, AlertConstants.WARNING_TYPE) .addParamsOptions(new ParamsOptions(WarningType.SUCCESS.getDescp(), WarningType.SUCCESS.getDescp(), false)) .addParamsOptions(new ParamsOptions(WarningType.FAILURE.getDescp(), WarningType.FAILURE.getDescp(), false)) .addParamsOptions(new ParamsOptions(WarningType.ALL.getDescp(), WarningType.ALL.getDescp(), false)) .setValue(WarningType.ALL.getDescp())
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertPluginManager.java
.addValidate(Validate.newBuilder().setRequired(true).build()) .build(); } @EventListener public void installPlugin(ApplicationReadyEvent readyEvent) { final Set<String> names = new HashSet<>(); ServiceLoader.load(AlertChannelFactory.class).forEach(factory -> { final String name = factory.name(); logger.info("Registering alert plugin: {}", name); if (!names.add(name)) { throw new IllegalStateException(format("Duplicate alert plugins named '%s'", name)); } final AlertChannel alertChannel = factory.create(); logger.info("Registered alert plugin: {}", name); final List<PluginParams> params = new ArrayList<>(factory.params()); params.add(0, warningTypeParams); final String paramsJson = PluginParamsTransfer.transferParamsToJson(params); final PluginDefine pluginDefine = new PluginDefine(name, PluginType.ALERT.getDesc(), paramsJson); final int id = pluginDao.addOrUpdatePluginDefine(pluginDefine); channelKeyedById.put(id, alertChannel); }); } public Optional<AlertChannel> getAlertChannel(int id) { return Optional.ofNullable(channelKeyedById.get(id)); } public int size() { return channelKeyedById.size(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertRequestProcessor.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 com.google.common.base.Preconditions.checkArgument; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.alert.AlertSendRequestCommand; import org.apache.dolphinscheduler.remote.command.alert.AlertSendResponseCommand; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; import org.apache.dolphinscheduler.remote.utils.JsonSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import io.netty.channel.Channel; @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertRequestProcessor.java
public final class AlertRequestProcessor implements NettyRequestProcessor { private static final Logger logger = LoggerFactory.getLogger(AlertRequestProcessor.class); private final AlertSender alertSender; public AlertRequestProcessor(AlertSender alertSender) { this.alertSender = alertSender; } @Override public void process(Channel channel, Command command) { checkArgument(CommandType.ALERT_SEND_REQUEST == command.getType(), "invalid command type: %s", command.getType()); AlertSendRequestCommand alertSendRequestCommand = JsonSerializer.deserialize( command.getBody(), AlertSendRequestCommand.class); logger.info("Received command : {}", alertSendRequestCommand); AlertSendResponseCommand alertSendResponseCommand = alertSender.syncHandler( alertSendRequestCommand.getGroupId(), alertSendRequestCommand.getTitle(), alertSendRequestCommand.getContent(), alertSendRequestCommand.getWarnType()); channel.writeAndFlush(alertSendResponseCommand.convert2Command(command.getOpaque())); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
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 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;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.event.EventListener; @SpringBootApplication @ComponentScan("org.apache.dolphinscheduler") public class AlertServer implements Closeable { private static final Logger logger = 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; @Autowired private AlertConfig config; 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; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
public static void main(String[] args) { SpringApplication.run(AlertServer.class, args); } @EventListener public void start(ApplicationReadyEvent readyEvent) { logger.info("Starting Alert server"); checkTable(); startServer(); Executors.newScheduledThreadPool(1) .scheduleAtFixedRate(new Sender(), 5, 5, TimeUnit.SECONDS); } @Override @PreDestroy public void close() { server.close(); } private void checkTable() { if (!pluginDao.checkPluginDefineTableExist()) { logger.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(config.getPort()); 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
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
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) { logger.error("Failed to send alert", e); } } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.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 junit.framework.TestCase; import org.apache.dolphinscheduler.dao.PluginDao; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; import org.powermock.reflect.Whitebox; @RunWith(MockitoJUnitRunner.class)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
public class AlertServerTest extends TestCase { @InjectMocks private AlertServer alertServer; @Mock private PluginDao pluginDao; @Mock private AlertConfig alertConfig; @Test public void testStart() { Mockito.when(pluginDao.checkPluginDefineTableExist()).thenReturn(true); Mockito.when(alertConfig.getPort()).thenReturn(50053); alertServer.start(null); NettyRemotingServer nettyRemotingServer = Whitebox.getInternalState(alertServer, "server"); NettyServerConfig nettyServerConfig = Whitebox.getInternalState(nettyRemotingServer, "serverConfig"); Assert.assertEquals(50053, nettyServerConfig.getListenPort()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/processor/AlertRequestProcessorTest.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.processor; import static org.mockito.Mockito.mock; import org.apache.dolphinscheduler.alert.AlertRequestProcessor; import org.apache.dolphinscheduler.alert.AlertSender; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.alert.AlertSendRequestCommand; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import io.netty.channel.Channel; public class AlertRequestProcessorTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/processor/AlertRequestProcessorTest.java
private AlertRequestProcessor alertRequestProcessor; @Before public void before() { final AlertDao alertDao = mock(AlertDao.class); alertRequestProcessor = new AlertRequestProcessor(new AlertSender(alertDao, null)); } @Test public void testProcess() { Channel channel = mock(Channel.class); AlertSendRequestCommand alertSendRequestCommand = new AlertSendRequestCommand(1, "title", "content", WarningType.FAILURE.getCode()); Command reqCommand = alertSendRequestCommand.convert2Command(); Assert.assertEquals(CommandType.ALERT_SEND_REQUEST, reqCommand.getType()); alertRequestProcessor.process(channel, reqCommand); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
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.plugin.task.api.enums.ExecutionStatus; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; import java.util.regex.Pattern; /** * Constants */ public final class Constants {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
private Constants() { throw new UnsupportedOperationException("Construct Constants"); } /** * common properties path */ public static final String COMMON_PROPERTIES_PATH = "/common.properties"; /** * 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; public static final String FORMAT_SS = "%s%s"; public static final String FORMAT_S_S = "%s/%s"; public static final String AWS_ACCESS_KEY_ID = "aws.access.key.id"; public static final String AWS_SECRET_ACCESS_KEY = "aws.secret.access.key"; public static final String AWS_REGION = "aws.region"; public static final String FOLDER_SEPARATOR = "/"; public static final String RESOURCE_TYPE_FILE = "resources"; public static final String RESOURCE_TYPE_UDF = "udfs"; public static final String STORAGE_S3 = "S3"; public static final String STORAGE_HDFS = "HDFS"; public static final String BUCKET_NAME = "dolphinscheduler-test"; /** * fs.defaultFS */ public static final String FS_DEFAULT_FS = "fs.defaultFS"; /** * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ 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 */ 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String RESOURCE_VIEW_SUFFIXES = "resource.view.suffixs"; public static final String RESOURCE_VIEW_SUFFIXES_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 */ public static final String STRING_TRUE = "true"; /** * resource storage type */ public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type"; public static final String AWS_END_POINT = "aws.endpoint"; /** * comma , */ public static final String COMMA = ","; /** * COLON : */ public static final String COLON = ":"; /** * QUESTION ?
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String QUESTION = "?"; /** * SPACE " " */ public static final String SPACE = " "; /** * SINGLE_SLASH / */ public static final String SINGLE_SLASH = "/"; /** * DOUBLE_SLASH // */ public static final String DOUBLE_SLASH = "//"; /** * EQUAL SIGN */ public static final String EQUAL_SIGN = "="; /** * AT SIGN */ public static final String AT_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"; /** * date format of yyyyMMdd */ public static final String YYYYMMDD = "yyyyMMdd";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * 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; /** * registry session timeout */ public static final int REGISTRY_SESSION_TIMEOUT = 10 * 1000; /** * http header */ public static final String HTTP_HEADER_UNKNOWN = "unKnown"; /** * http X-Forwarded-For
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
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}$"); /** * 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; /** * default admin permission */ public static final int DEFAULT_ADMIN_PERMISSION = 7;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * default hash map size */ public static final int DEFAULT_HASH_MAP_SIZE = 16; /** * 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 String RPC_PORT = "rpc.port"; /** * forbid running task */ public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* normal running task */ 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate"; /** * complement date default cron string */ public static final String DEFAULT_CRON_STRING = "0 0 0 * * ? *"; /** * sleep 1000ms */ public static final int SLEEP_TIME_MILLIS = 1000; /** * short sleep 100ms */ public static final int SLEEP_TIME_MILLIS_SHORT = 100; /** * 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"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* hadoop */ public static final String HADOOP = "hadoop"; /** * -D <property>=<value> */ public static final String D = "-D"; /** * 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 */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss"; /** * system date(yyyyMMddHHmmss) */ public static final String PARAMETER_DATETIME = "system.datetime"; /** * system date(yyyymmdd) today */ 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"; /** * ENDED */ public static final String ENDED = "ENDED"; /** * NEW */ public static final String NEW = "NEW"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* NEW_SAVING */ public static final String NEW_SAVING = "NEW_SAVING"; /** * SUBMITTED */ public static final String SUBMITTED = "SUBMITTED"; /** * FAILED */ public static final String FAILED = "FAILED"; /** * 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_PREFIX = "job"; /** * quartz job group prifix */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String QUARTZ_JOB_GROUP_PREFIX = "jobgroup"; /** * projectId */ public static final String PROJECT_ID = "projectId"; /** * processId */ public static final String SCHEDULE_ID = "scheduleId"; /** * schedule */ 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * 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"; 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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; public static final String BLOCKING_CONDITION = "blockingCondition"; public static final String ALERT_WHEN_BLOCKING = "alertWhenBlocking"; /** * master/worker server use for zk */ 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * 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 */ 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ 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.DISPATCH.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(), ExecutionStatus.WAITING_DEPEND.ordinal() }; public static final int[] RUNNING_PROCESS_STATE = new int[]{ ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.DISPATCH.ordinal(), ExecutionStatus.SERIAL_WAIT.ordinal() }; /** * status */ public static final String STATUS = "status"; /** * message */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; /** * */ 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
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"; public static final String USER = "user"; public static final String JDBC_URL = "jdbcUrl"; /** * session timeout */ 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";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * 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"); /** * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
9,221
[Improvement] [alert-server] AlertSender optimization and gracefully close, such as MasterServer
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description In alert-server, I have two suggestions - I think sending alert messages should go out to class of `AlertServer` independently, that it is mainly responsible for the send alert, we can define as `AlertSenderService` - I think class of `AlertServer` should implements interface of `IStoppable`, and have gracefully close, such as MasterServer or WorkerServer ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/9221
https://github.com/apache/dolphinscheduler/pull/9246
ab0357027d4a06aa26df6bf2345e429d9b9b6c5c
ca95d2f9282fd234d954194bab40a5bfc713c433
2022-03-27T11:01:48Z
java
2022-04-08T02:02:10Z
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ 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; /** * data.quality.error.output.path */ public static final String DATA_QUALITY_ERROR_OUTPUT_PATH = "data-quality.error.output.path"; public static final String CACHE_KEY_VALUE_ALL = "'all'"; /** * use for k8s */ public static final String NAMESPACE = "namespace"; public static final String K8S = "k8s"; public static final String LIMITS_CPU = "limitsCpu"; public static final String LIMITS_MEMORY = "limitsMemory"; }