Github user madrob commented on a diff in the pull request:
https://github.com/apache/curator/pull/35#discussion_r16054657
--- 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 --
Is there a possible race condition between issuing the background delete
and reassigning the protectedId? I almost think we would want to swap the
order. (Intuition only, no concerete examples of this).
---
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 [email protected] or file a JIRA ticket
with INFRA.
---