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/08/11 10:17:08 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11368: [Feature-7024] Add waiting strategy to support master/worker can recover from registry lost

caishunfeng commented on code in PR #11368:
URL: https://github.com/apache/dolphinscheduler/pull/11368#discussion_r943321935


##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/WorkerManagerThread.java:
##########
@@ -153,8 +154,14 @@ public void run() {
                 }
             } catch (Exception e) {
                 logger.error("An unexpected interrupt is happened, "
-                    + "the exception will be ignored and this thread will continue to run", e);
+                        + "the exception will be ignored and this thread will continue to run", e);
             }
         }
     }
+
+    public void clearTask() {
+        waitSubmitQueue.clear();
+        workerExecService.getTaskExecuteThreadMap().values().forEach(TaskExecuteThread::kill);

Review Comment:
   Is it better to add try catch for kill action?



##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/cron/CronUtils.java:
##########
@@ -147,7 +143,7 @@ public static List<ZonedDateTime> getFireDateList(@NonNull ZonedDateTime startTi
         List<ZonedDateTime> dateList = new ArrayList<>();
         ExecutionTime executionTime = ExecutionTime.forCron(cron);
 
-        while (Stopper.isRunning()) {
+        while (!ServerLifeCycleManager.isStopped()) {

Review Comment:
   Should we check server status here? Maybe it's no need.



##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryClient.java:
##########
@@ -142,33 +139,8 @@ public Map<String, String> getServerMaps(NodeType nodeType, boolean hostOnly) {
 
     public boolean checkNodeExists(String host, NodeType nodeType) {
         return getServerMaps(nodeType, true).keySet()
-                                            .stream()
-                                            .anyMatch(it -> it.contains(host));
-    }
-
-    public void handleDeadServer(Collection<String> nodes, NodeType nodeType, String opType) {

Review Comment:
   It's necessary to update the docs.



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