Browse Source

[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 <534328519@qq.com>
3.0.0/version-upgrade
wind 3 years ago committed by GitHub
parent
commit
06e8e24708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java

7
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistryClient.java

@ -122,15 +122,22 @@ public class WorkerRegistryClient {
* remove registry info * remove registry info
*/ */
public void unRegistry() { public void unRegistry() {
try {
String address = getLocalAddress(); String address = getLocalAddress();
Set<String> workerZkPaths = getWorkerZkPaths(); Set<String> workerZkPaths = getWorkerZkPaths();
for (String workerZkPath : workerZkPaths) { for (String workerZkPath : workerZkPaths) {
registryClient.remove(workerZkPath); registryClient.remove(workerZkPath);
logger.info("worker node : {} unRegistry from ZK {}.", address, workerZkPath); logger.info("worker node : {} unRegistry from ZK {}.", address, workerZkPath);
} }
} catch (Exception ex) {
logger.error("remove worker zk path exception", ex);
}
this.heartBeatExecutor.shutdownNow(); this.heartBeatExecutor.shutdownNow();
logger.info("heartbeat executor shutdown"); logger.info("heartbeat executor shutdown");
registryClient.close(); registryClient.close();
logger.info("registry client closed");
} }
/** /**

Loading…
Cancel
Save