[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288405#comment-13288405
 ] 

Ivan Kelly commented on BOOKKEEPER-281:
---------------------------------------

@Sijie
1. This is a change to fix a intermittent failure of the test, due to the 
change in how BOOKKEEPER-258 made timeouts work. Before 258, we set the timeout 
and when it hit, we just killed everything. Now we set the timeout, and when it 
triggers, we check if that amount of time has passed with the request 
outstanding and if so error the request. As the timeout timer is set on the 
connection and not the individual requests, and the requests can be made a 
couple of ms after the connection is set up, sometimes it can take 2 timeout 
periods for the requests to be timed out. This change ensures that this happens.

2. This is true. I think the overall problem here is that its not possible to 
set a Watcher on a ZooKeeper without overriding the previous one. This means 
that there's no real clean way to say "Don't process anything on this zk until 
it has connected". 

@Rakesh
1. I'll look into how best to fail fast and generate a new patch.
2. Passing the exception back would require waiting for the exception to occur, 
i.e. blocking. If this is acceptable, we would be better off just making the 
whole BookKeeper constructor to be blocking (I'm considering this as a possible 
solution).
3. Same answer as 2.
                
> BKClient is failing when zkclient connection delays
> ---------------------------------------------------
>
>                 Key: BOOKKEEPER-281
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-281
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.1.0, 4.2.0
>
>         Attachments: BOOKKEEPER-281.diff, BOOKKEEPER-281.diff
>
>
> I have started the ZK cluster and when tries to create a BookKeeper client 
> from my application, it is throwing following ZooKeeper 
> ConnectionLossException and is exitting.
> 12/06/01 11:44:31 WARN client.ZooKeeperSaslClient: SecurityException: 
> java.lang.SecurityException: Unable to locate a login configuration occurred 
> when trying to find JAAS configuration.
> 12/06/01 11:44:31 INFO client.ZooKeeperSaslClient: Client will not 
> SASL-authenticate because the default JAAS configuration section 'Client' 
> could not be found. If you are not using SASL, you may ignore this. On the 
> other hand, if you expected SASL to work, please fix your JAAS configuration.
> 12/06/01 11:44:31 INFO zookeeper.ClientCnxn: Client session timed out, have 
> not heard from server in 4540ms for sessionid 0x0, closing socket connection 
> and attempting reconnect
> 12/06/01 11:44:32 INFO zookeeper.ClientCnxn: Opening socket connection to 
> server /10.18.40.91:2182
> Exception in thread "main" 
> org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode 
> = ConnectionLoss
>        at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
>        at 
> org.apache.bookkeeper.client.BookieWatcher.readBookiesBlocking(BookieWatcher.java:151)
>        at org.apache.bookkeeper.client.BookKeeper.<init>(BookKeeper.java:139)
>        at BKClient1.main(BKClient1.java:40)
> 12/06/01 11:44:36 WARN client.ZooKeeperSaslClient: SecurityException: 
> java.lang.SecurityException: Unable to locate a login configuration occurred 
> when trying to find JAAS configuration.
> When analyzed more, the root cause is:
> BookKeeper.java:
> --------------------
> In the constructor of BookKeeper, immediately after creating the ZK client , 
> it is going to bookieWatcher.readBookiesBlocking() for available bookies from 
> ZK server before reaching SyncConnected event.
> I think, we would properly use the existing countdown latch and wait till 
> ZooKeeper client connection establishment before continue reading Bookies.

--
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

        

Reply via email to