curator-dev mailing list archives

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

    https://github.com/apache/curator/pull/35#discussion_r16057954
  
    --- 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 --
    
    Yes, copy the existing ID, generate and assign a new one, and then delete the old one.


---
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