Github user ghelmling commented on a diff in the pull request:
https://github.com/apache/incubator-twill/pull/34#discussion_r30920964
--- Diff:
twill-zookeeper/src/main/java/org/apache/twill/internal/zookeeper/LeaderElection.java
---
@@ -240,10 +240,10 @@ private void becomeFollower() {
* Starts watching for the max. of smaller node.
*/
private void watchNode(final String nodePath, Watcher watcher) {
- OperationFuture<Stat> watchFuture = zkClient.exists(nodePath, watcher);
- Futures.addCallback(watchFuture, new FutureCallback<Stat>() {
+ OperationFuture<NodeData> watchFuture = zkClient.getData(nodePath,
watcher);
--- End diff --
So this is relying on the fact that a KeeperException.NoNodeException will
be thrown if the node has already been removed? That would trigger the
onFailure() hook and re-run the election. Is that right?
---
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.
---