[ https://issues.apache.org/jira/browse/CURATOR-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jordan Zimmerman updated CURATOR-132: ------------------------------------- Fix Version/s: 2.7.0 > 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 > Assignee: Cameron McKenzie > Fix For: 2.7.0 > > > 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)