You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Mike Drob (JIRA)" <ji...@apache.org> on 2014/08/01 01:45:39 UTC
[jira] [Commented] (CURATOR-132) setACL doesn't work with
namespaced curator
[ https://issues.apache.org/jira/browse/CURATOR-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14081688#comment-14081688 ]
Mike Drob commented on CURATOR-132:
-----------------------------------
[~vines], I don't think this is an issue with the namespace facade, I think it is an issue with attempting to set an ACL twice. If you change the second {{setACL}} call to use {{curator}} instead of {{curator2}}, then it will still fail, demonstrating that it's not a namespace issue.
Alternatively, if you change the first call to {{ZooDefs.Perms.ADMIN}}, then it will pass, even with the namespaced second call.
> setACL doesn't work with namespaced curator
> -------------------------------------------
>
> Key: CURATOR-132
> URL: https://issues.apache.org/jira/browse/CURATOR-132
> Project: Apache Curator
> Issue Type: Bug
> Components: Framework
> Affects Versions: 2.3.0, 2.6.0
> Reporter: John Vines
>
> Experienced this on 2.3.0, doesn't seem to be resolved in 2.6.0
> Attempting to setACL with a namespaced curator fails to recognize the namespace. It seems that setACL doesn't properly pass on the Namespaced facade. The following test code is an exemplar.
> {code}public class BreakCurator {
> public static void main(String args[]) throws Exception {
> TestingServer ts = new TestingServer();
> CuratorFramework curator = CuratorFrameworkFactory.builder().connectString(ts.getConnectString()).retryPolicy(new ExponentialBackoffRetry(1000, 5)).build();
> curator.start();
> curator.getZookeeperClient().blockUntilConnectedOrTimedOut();
> curator.create().creatingParentsIfNeeded().forPath("/parent/child", "A string".getBytes());
> CuratorFramework curator2 = curator.usingNamespace("parent");
> try {
> System.out.println(new String(curator2.getData().forPath("child")));
> curator.setACL().withACL(Collections.singletonList(new ACL(ZooDefs.Perms.WRITE, ZooDefs.Ids.ANYONE_ID_UNSAFE))).forPath("/parent/child");
> // This should attempt to setACL on /parent/child, but instead fails because /child isn't present. Using "child" causes a failure because the path doesn't start with a slash
> curator2.setACL().withACL(Collections.singletonList(new ACL(ZooDefs.Perms.DELETE, ZooDefs.Ids.ANYONE_ID_UNSAFE))).forPath("/child");
> System.out.println(curator2.getACL().forPath("/child"));
> } catch (Exception e) {
> e.printStackTrace();
> }
> ts.close();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)