ruanwenjun commented on a change in pull request #6621:
URL: https://github.com/apache/dolphinscheduler/pull/6621#discussion_r737981062
##########
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:
What I concern is that when the connection lost, will it reconnect
again? Since the catch scope here may cause the registry.close() will not be
executed.
And other thing need to confirm, will it cause some thread fail to exit? I
am not clear.
--
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]