curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan Zimmerman (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CURATOR-136) Invalid LeaderLatch path never errors
Date Wed, 20 Aug 2014 21:15:27 GMT

     [ https://issues.apache.org/jira/browse/CURATOR-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jordan Zimmerman reassigned CURATOR-136:
----------------------------------------

    Assignee: Jordan Zimmerman

> Invalid LeaderLatch path never errors
> -------------------------------------
>
>                 Key: CURATOR-136
>                 URL: https://issues.apache.org/jira/browse/CURATOR-136
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.6.0
>            Reporter: John Vines
>            Assignee: Jordan Zimmerman
>             Fix For: 2.7.0
>
>
> I was messing with the LeaderLatch and I noticed some ill behavior for the pathing of
it. Given the following code-
> {code}  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", "A string".getBytes());
>     
>     try {
>       LeaderLatch ll = new LeaderLatch(curator, "parent", "myNode");
>       ll.start();
>       ll.await();
>       System.out.println(ll.hasLeadership());
>       ll.close();
>     } catch (Exception e) {
>       e.printStackTrace();
>     }
>     ts.close();
>   }
> {code}
> the system will just hang forever. Inspecting the TestingServer with zkcli shows entries
showing up though.
> If I switch out the path in the LeaderLatch constructor with "/parent", the same path
is created AND the program runs fine.
> LeaderLatch should either accept the path all around or fail outright, not this half
state that makes things difficult for the user.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message