You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by lg...@apache.org on 2020/05/06 06:46:57 UTC

[incubator-dolphinscheduler] branch dev updated: No master don't create command #2571 (#2602)

This is an automated email from the ASF dual-hosted git repository.

lgcareer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 21bd3c1  No master don't create command #2571 (#2602)
21bd3c1 is described below

commit 21bd3c1488615ca7cb8ddb07263f2aac1b0cffbd
Author: qiaozhanwei <qi...@outlook.com>
AuthorDate: Wed May 6 14:46:47 2020 +0800

    No master don't create command #2571 (#2602)
    
    * dispatch task fail will set task status failed
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,no worker condition , master will while ture wait for worker startup
    2,worker response task status sync wait for result
    
    * 1,task status statistics and process status statistics bug fix (#2357)
    2,worker group bug fix
    
    * 1,task status statistics and process status statistics bug fix (#2357)
    2,worker group bug fix
    
    * 1,task status statistics and process status statistics bug fix (#2357)
    2,worker group bug fix
    
    * 1,task status statistics and process status statistics bug fix (#2357)
    2,worker group bug fix
    
    * send mail error, #2466 bug fix
    
    * send mail error, #2466 bug fix
    
    * send mail error, #2466 bug fix
    
    * send mail error, #2466 bug fix
    
    * #2486 bug fix
    
    * host and workergroup compatible
    
    * EnterpriseWeChatUtils modify
    
    * EnterpriseWeChatUtils modify
    
    * EnterpriseWeChatUtils modify
    
    * #2499 bug fix
    
    * add comment
    
    * revert comment
    
    * revert comment
    
    * #2499 buf fix
    
    * #2499 bug fix
    
    * #2499 bug fix
    
    * #2499 bug fix
    
    * #2499 bug fix
    
    * #2499 bug fix
    
    * #2499 bug fix
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * no valid worker group,master can kill task directly
    
    * No master don't create command #2571
    
    * No master don't create command #2571
    
    * No master don't create command #2571
    
    Co-authored-by: qiaozhanwei <qi...@analysys.com.cn>
---
 .../api/service/ExecutorService.java               | 32 ++++++++++++++++++----
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
index 1aab095..611d3ea 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java
@@ -124,14 +124,12 @@ public class ExecutorService extends BaseService{
             return result;
         }
 
-        // check master server exists
-        List<Server> masterServers = monitorService.getServerListFromZK(true);
-
-
-        if (masterServers.size() == 0) {
-            putMsg(result, Status.MASTER_NOT_EXISTS);
+        // check master exists
+        if (!checkMasterExists(result)) {
             return result;
         }
+
+
         /**
          * create command
          */
@@ -152,6 +150,22 @@ public class ExecutorService extends BaseService{
         return result;
     }
 
+    /**
+     * check whether master exists
+     * @param result result
+     * @return master exists return true , otherwise return false
+     */
+    private boolean checkMasterExists(Map<String, Object> result) {
+        // check master server exists
+        List<Server> masterServers = monitorService.getServerListFromZK(true);
+
+        // no master
+        if (masterServers.size() == 0) {
+            putMsg(result, Status.MASTER_NOT_EXISTS);
+            return false;
+        }
+        return true;
+    }
 
 
     /**
@@ -195,6 +209,12 @@ public class ExecutorService extends BaseService{
             return checkResult;
         }
 
+        // check master exists
+        if (!checkMasterExists(result)) {
+            return result;
+        }
+
+
         ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
         if (processInstance == null) {
             putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);