This commit is contained in:
mcy
2019-01-17 11:27:12 +08:00
parent 2d88d803ee
commit ba9d9dea6d
2 changed files with 3 additions and 2 deletions

View File

@@ -508,6 +508,7 @@ public class CanalController {
zkclientx.close(); zkclientx.close();
} }
//关闭时清理缓存
if (instanceConfigs != null) { if (instanceConfigs != null) {
instanceConfigs.clear(); instanceConfigs.clear();
} }

View File

@@ -56,7 +56,7 @@ public class ZooKeeperMetaManager extends AbstractCanalLifeCycle implements Cana
} }
public void stop() { public void stop() {
zkClientx = null; zkClientx = null; //关闭时置空
super.stop(); super.stop();
} }
@@ -102,7 +102,7 @@ public class ZooKeeperMetaManager extends AbstractCanalLifeCycle implements Cana
} }
public List<ClientIdentity> listAllSubscribeInfo(String destination) throws CanalMetaManagerException { public List<ClientIdentity> listAllSubscribeInfo(String destination) throws CanalMetaManagerException {
if (zkClientx == null) { if (zkClientx == null) { //重新加载时可能为空
return new ArrayList<ClientIdentity>(); return new ArrayList<ClientIdentity>();
} }
String path = ZookeeperPathUtils.getDestinationPath(destination); String path = ZookeeperPathUtils.getDestinationPath(destination);