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/10/29 09:44:16 UTC

[dolphinscheduler] branch dev 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 dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


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

commit 06e8e24708e2c2a2b9367b9e76a4dc0cec4cdfc6
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");
     }
 
     /**