You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/03 19:31:28 UTC

[GitHub] [accumulo] jzgithub1 commented on a change in pull request #1443: Fixes #1220 - Removes ZooKeeper watches on table configs when table is deleted.

jzgithub1 commented on a change in pull request #1443: Fixes #1220  -  Removes ZooKeeper watches on table configs when table is deleted.
URL: https://github.com/apache/accumulo/pull/1443#discussion_r353378733
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
 ##########
 @@ -435,6 +475,46 @@ public T retry() {
     return zr.retry();
   }
 
+  /*
+   * Some of the table configuration parameters are possibly not in ZooKeeper yet and even though
+   * you are able you should not put a watcher on them to observe the NodeCreated event. If you do
+   * that and the ZNode for that configuration is never created, you will have no way to delete the
+   * watcher you created for it in Zookeeper. Unremovable watchers that are created for for table
+   * configs that never actually have a Znode is causing memory leaks in Accumulo instances that
+   * create and delete tables at a high rate.
+   */
+
+  private boolean isWatched(ZooKeeper zooKeeper, String zPath)
+      throws KeeperException, InterruptedException {
+
+    boolean watched = true;
+
+    if (znodeExists.contains(zPath))
+      return watched;
+
+    Matcher configMatcher = TABLE_SETTING_CONFIG_PATTERN.matcher(zPath);
+
+    if (configMatcher.matches()) {
+      Stat stat;
+      try {
+        stat = zooKeeper.exists(zPath, false);
+      } catch (KeeperException.BadVersionException | KeeperException.NoNodeException e1) {
+        throw new ConcurrentModificationException();
 
 Review comment:
   Thanks.  I will just re-throw the exception.  

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services