curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cammckenzie <...@git.apache.org>
Subject [GitHub] curator pull request: CURATOR-79 - Modified the 'withProtection' h...
Date Mon, 11 Aug 2014 21:55:25 GMT
Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/35#discussion_r16083287
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
---
    @@ -469,6 +469,26 @@ private String protectedPathInForeground(String adjustedPath, byte[]
data) throw
                 }
                 throw e;
             }
    +        catch ( KeeperException e )
    +        {
    +            throw e;
    +        }
    +        catch ( Exception e )
    +        {
    +            if ( protectedId != null )
    +            {
    +                /*
    +                 * CURATOR-79 - Handle an runtime exception's here and treat the
    +                 * same as a connection loss exception. This is necessary as, from
    +                 * the clients point of view, an exception has been thrown and the
    +                 * zNode should not exist on ZK. This was causing deadlock in the
    +                 * locking recipes.
    +                 */
    +                findAndDeleteProtectedNodeInBackground(adjustedPath, protectedId, null);
    +                protectedId = UUID.randomUUID().toString();
    --- End diff --
    
    I don't think there's a race condition given that the findAndDeleteProtectionNodeInBackground
is being passed a reference to the ID it needs to delete. I will change to assign to a local
variable and pass this to the findAndDeleteProtectionNodeInBackground method for clarity.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message