Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper >> mail # dev >> zookeeper_interest returning ZOK on Connection Loss


+
Yunong Xiao 2012-11-04, 22:11
+
Michi Mutsuzaki 2012-11-05, 18:33
+
Yunong Xiao 2012-11-05, 21:19
+
Michi Mutsuzaki 2012-11-05, 21:59
+
Yunong Xiao 2012-11-05, 22:16
+
Michi Mutsuzaki 2012-11-06, 07:24
Copy link to this message
-
Re: zookeeper_interest returning ZOK on Connection Loss
Michi --

On Nov 5, 2012, at 11:24 PM, Michi Mutsuzaki <[EMAIL PROTECTED]> wrote:

> On Mon, Nov 5, 2012 at 2:16 PM, Yunong Xiao <[EMAIL PROTECTED]> wrote:
>> What happens if the server is offline? In the scenario you described, select()
>> will never succeed, and zookeeper_interest() will never inform the upstream
>> consumer that the server is down. That's the crux of the problem here, when the
>> server is unavailable, the client needs to know after some amount of time that
>> the connection has failed. Otherwise the upstream consumer has no idea the
>> connection to zookeeper has been severed and will hang indefinitely.
>
> If the server is offline, zookeeper client keeps trying to connect to
> the server indefinitely. It's up to the caller to decide when to give
> up. One possibility is to poll the connection state using zoo_state()
> and give up on the handle if it doesn't become connected after certain
> time.

I certainly don't disagree here. What you're suggesting makes sense here -- indeed my patch does a variation of this -- however, it relies on the consuming client to keep track of the time since the client was last connected to the server. I dare say it'd be more preferable for zookeeper.c to keep track of this time internally, and inform the consuming client when this time has exceeded a certain threshold, such as session_timeout. The consuming client can then decide to give up. It seems like common functionality that all consumers would like to have as part of using the C client.
+
Anthony Barré 2013-03-27, 09:41
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB