ruanwenjun commented on a change in pull request #6621:
URL: https://github.com/apache/dolphinscheduler/pull/6621#discussion_r737943289
##########
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:
It might better just catch `KeeperException.ConnectionLossException`
here?
```suggestion
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 (KeeperException.ConnectionLossException ex) {
logger.error("remove worker zk path exception", ex)
}
this.heartBeatExecutor.shutdownNow();
logger.info("heartbeat executor shutdown");
registryClient.close();
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]