Unverified Commit 88f9bed7 authored by tswstarplanet's avatar tswstarplanet Committed by GitHub
Browse files

[Bug-3187]close Heartbeat thread pool when MasterRegistry unRegistry (#3188)

* [Bug-3187]close Heartbeat thread pool when MasterRegistry unRegistry

* use shutdownNow; delete redundant code
parent 98fdba67
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package org.apache.dolphinscheduler.server.master.registry;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
@@ -37,8 +36,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import static org.apache.dolphinscheduler.remote.utils.Constants.COMMA;

/**
 *  master registry
 */
@@ -113,6 +110,7 @@ public class MasterRegistry {
    public void unRegistry() {
        String address = getLocalAddress();
        String localNodePath = getMasterPath();
        heartBeatExecutor.shutdownNow();
        zookeeperRegistryCenter.getZookeeperCachedOperator().remove(localNodePath);
        logger.info("master node : {} unRegistry to ZK.", address);
    }