[sheepdog] [PATCH v6 6/6] zookeeper: handle session timeout for all zookeeper operations

Liu Yuan namei.unix at gmail.com
Sat Jun 22 10:47:50 CEST 2013


On 06/22/2013 04:17 PM, Kai Zhang wrote:
> Maybe there is a misunderstanding.
> Based on my knowledge, zookeeper API will return a session timeout code only when it has re-established tcp connection to zookeeper server after a connection loss. And this will definitely trigger the zk watcher with a session event.
> 
> So I think there is no need to place a reconnect logic after each zk operation returns a session timeout code. 
> Just let the zk watcher to trigger a event. And the reconnect will be handled in that event handler.
> This can also ensure that there is no flying zk operations.
> 

This make sense to me, and rationale should be concisely included in the
source.

> And it will add complexity to code if we reconnect just after a zk operation.
> For example, for a simple get children operation, a reconnect and retry is enough. But for a push_join_response, we have to determine the mastership before retry. 
> So I would prefer to a simple uniformed rule that is described in the commit log.

I see, look good to me.

Thanks,
Yuan




More information about the sheepdog mailing list