You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/11/01 15:23:19 UTC

[dolphinscheduler] branch 2.0.0-release-prepare updated: [DS-6616][WorkerServer] fix worker stop fail and fakes death (#6621)

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

leonbao pushed a commit to branch 2.0.0-release-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.0-release-prepare by this push:
     new d83661d  [DS-6616][WorkerServer] fix worker stop fail and fakes death (#6621)
d83661d is described below

commit d83661db25a1d5f23607583aa182d3c270046303
Author: wind <ca...@users.noreply.github.com>
AuthorDate: Fri Oct 29 17:44:06 2021 +0800

    [DS-6616][WorkerServer] fix worker stop fail and fakes death (#6621)
    
    * [DS-6616][WorkerServer] fix worker stop fail and fakes death
    
    * remove unuse test
    
    * just add try catch to remove zk worker path
    
    Co-authored-by: caishunfeng <53...@qq.com>
---
 .../server/worker/registry/WorkerRegistryClient.java    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java
index e8c6ad0..b59e3ec 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java
@@ -122,15 +122,22 @@ public class WorkerRegistryClient {
      * remove registry info
      */
     public void unRegistry() {
-        String address = getLocalAddress();
-        Set<String> workerZkPaths = getWorkerZkPaths();
-        for (String workerZkPath : workerZkPaths) {
-            registryClient.remove(workerZkPath);
-            logger.info("worker node : {} unRegistry from ZK {}.", address, workerZkPath);
+        try {
+            String address = getLocalAddress();
+            Set<String> workerZkPaths = getWorkerZkPaths();
+            for (String workerZkPath : workerZkPaths) {
+                registryClient.remove(workerZkPath);
+                logger.info("worker node : {} unRegistry from ZK {}.", address, workerZkPath);
+            }
+        } catch (Exception ex) {
+            logger.error("remove worker zk path exception", ex);
         }
+
         this.heartBeatExecutor.shutdownNow();
         logger.info("heartbeat executor shutdown");
+
         registryClient.close();
+        logger.info("registry client closed");
     }
 
     /**