mcy 6 år sedan
förälder
incheckning
ba9d9dea6d

+ 1 - 0
deployer/src/main/java/com/alibaba/otter/canal/deployer/CanalController.java

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

+ 2 - 2
meta/src/main/java/com/alibaba/otter/canal/meta/ZooKeeperMetaManager.java

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