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 2021/10/28 01:44:33 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a change in pull request #6621: [DS-6616][WorkerServer] fix worker stop fail and fakes death

caishunfeng commented on a change in pull request #6621:
URL: https://github.com/apache/dolphinscheduler/pull/6621#discussion_r737960724



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java
##########
@@ -122,15 +122,20 @@ public void registry() {
      * 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);
+            }
+            this.heartBeatExecutor.shutdownNow();
+            logger.info("heartbeat executor shutdown");
+            registryClient.close();
+        } catch (Exception ex) {

Review comment:
       I think it should catch all exception here, because it is the final catch for remove registry info. If it juse catch some exception, the problem will arise again.




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