You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/02/09 10:48:03 UTC

[GitHub] [dolphinscheduler] mgsky1 commented on a change in pull request #6272: [Feature-5752][server & UI]Add blocking task

mgsky1 commented on a change in pull request #6272:
URL: https://github.com/apache/dolphinscheduler/pull/6272#discussion_r802527928



##########
File path: dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
##########
@@ -652,6 +661,23 @@ private boolean processStateChangeHandler(StateEvent stateEvent) {
         return true;
     }
 
+    private boolean processBlockHandler(StateEvent stateEvent) {
+        try {
+            TaskInstance task = processService.findTaskInstanceById(stateEvent.getTaskInstanceId());
+            BlockingParameters parameters = (BlockingParameters) TaskParametersUtils.getParameters(TaskType.BLOCKING.getDesc(),
+                    task.getTaskParams());
+            if (parameters.isAlertWhenBlocking()) {
+                ProjectUser projectUser = processService.queryProjectWithUserByProcessInstanceId(processInstance.getId());
+                processAlertManager.sendProcessBlockingAlert(processInstance, projectUser);
+                logger.info("block alert send successful!");
+            }
+            taskStateChangeHandler(stateEvent);

Review comment:
       When detecting process block flag becomes true, I think it can send two events, one for task status change(blocking task runs complete), another for blocking the process. What do you think about this? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org