You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/05/23 14:25:29 UTC
[5/5] git commit: updated comments
updated comments
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/4e548a29
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/4e548a29
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/4e548a29
Branch: refs/heads/CURATOR-107
Commit: 4e548a29e60c3de1809db4eedf320e38f925671e
Parents: c6700f0
Author: randgalt <ra...@apache.org>
Authored: Fri May 23 07:25:00 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 23 07:25:00 2014 -0500
----------------------------------------------------------------------
.../curator/framework/recipes/locks/LockInternals.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/4e548a29/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java
index 0f7460f..812cfd8 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/LockInternals.java
@@ -296,6 +296,7 @@ public class LockInternals
{
try
{
+ // use getData instead of exists to avoid leaving unneeded watchers which is a type of resource leak
client.getData().usingWatcher(watcher).forPath(previousSequencePath);
if ( millisToWait != null )
{
@@ -316,16 +317,10 @@ public class LockInternals
}
catch ( KeeperException.NoNodeException e )
{
- // ignore - clearly already deleted
- }
- catch ( Exception e)
- {
- // bubble it up
- throw e;
+ // it has been deleted (i.e. lock released). Try to acquire again
}
}
}
- // else it may have been deleted (i.e. lock released). Try to acquire again
}
}
catch ( Exception e )