You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2012/05/31 17:31:23 UTC
[jira] [Commented] (BOOKKEEPER-279) LocalBookKeeper is failing
intermittently due to zkclient connection establishment delay
[ https://issues.apache.org/jira/browse/BOOKKEEPER-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286658#comment-13286658 ]
Sijie Guo commented on BOOKKEEPER-279:
--------------------------------------
the patch seems good to me. just one comment.
{code}
- zkc = new ZooKeeper("127.0.0.1", ZooKeeperDefaultPort, new emptyWatcher());
+ CountdownWatcher zkConnectionWatcher = new CountdownWatcher();
+ zkc = new ZooKeeper("127.0.0.1", zkSessionTimeOut,
+ zkConnectionWatcher);
{code}
from my knowledge, if user doesn't specify zookeeper port in connect string, it would use default port to connect. so if I changed ZooKeeperDefaultPort, the ZooKeeper instance would not work probably. So why not append ZooKeeperDefaultPort after '127.0.0.1'?
> LocalBookKeeper is failing intermittently due to zkclient connection establishment delay
> ----------------------------------------------------------------------------------------
>
> Key: BOOKKEEPER-279
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-279
> Project: Bookkeeper
> Issue Type: Bug
> Components: bookkeeper-client
> Affects Versions: 4.0.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.1.0
>
> Attachments: BOOKKEEPER-279.patch
>
>
> LocalBookKeeper is initializing the zkclient and immediately trying to create "/ledgers" and "/ledgers/available" znodes without waiting for the ZooKeeper SyncConnected state. The client operation should be guarded with ZKConnectionWatcher.
> LocalBookKeeper.java
> {noformat}
> zkc = new ZooKeeper("127.0.0.1", ZooKeeperDefaultPort, new emptyWatcher());
> /* User for testing purposes, void */
> static class emptyWatcher implements Watcher {
> public void process(WatchedEvent event) {}
> }
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira