hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: Clarification on async calls in a cluster
Date Thu, 12 Aug 2010 01:29:30 GMT

On 08/11/2010 03:25 PM, Jordan Zimmerman wrote:
> If I use an async version of a call in a cluster ("ensemble") what
> happens if the server I'm connected to goes down? Does ZK
> transparently resubmit the call to the next server in the cluster and
> call my async callback or is there something I need to do? The docs
> aren't clear on this and searching the archive didn't give me the
> answer. Another source of confusion here is that the non-async
> versions do not resubmit the call - I need to do that manually.
> Thanks!

Hi Jordan, the callbacks have a "rc" parameter that details the result 
of the request (result code), this will be one of KeeperException.Code, 
in this case CONNECTIONLOSS. You receive a connection loss result when 
the client has sent a request to the server but loses the connection 
before the server responds. You must resubmit of this request manually 
(usually once you reconnect to the cluster), same as for sync calls.

See these sections in the faq:

also some detail in

I agree the docs could be improved here. The java api for callback is 
esp. embarassing (there is none). Please enter JIRAs for any areas you'd 
like to see improved, including adding javadoc to the callbacks.



View raw message