felix-thinkingdata commented on a change in pull request #4120:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/4120#discussion_r532016334



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java
##########
@@ -120,30 +121,46 @@
         return result;
     }
 
-
     /**
-     *  get worker groups
+     * get worker groups
      *
      * @param isPaging whether paging
      * @return WorkerGroup list
      */
     private List<WorkerGroup> getWorkerGroups(boolean isPaging) {
-        String workerPath = 
zookeeperCachedOperator.getZookeeperConfig().getDsRoot()+"/nodes" +"/worker";
-        List<String> workerGroupList = 
zookeeperCachedOperator.getChildrenKeys(workerPath);
+
+        String workerPath = 
zookeeperCachedOperator.getZookeeperConfig().getDsRoot() + "/nodes" + "/worker";
+        List<WorkerGroup> workerGroups = new ArrayList<>();
+        List<String> workerGroupList;
+        try {
+            workerGroupList = 
zookeeperCachedOperator.getChildrenKeys(workerPath);
+        } catch (Exception e) {
+            if (e.getMessage().contains(noNodeExceptionRegex)) {

Review comment:
       I need to deal with two results, which is not easy to deal with。
   
   这块要处理两个结果,抽取方法,不太好处理。




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to