You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Kuba Lekstan <ku...@gmail.com> on 2014/03/25 13:43:18 UTC
C client state goes to 0 - should it?
Hello,
In destroy (zookeeper.c:401) and handle_error (zookeeper:1236) functions
the state property of zhandle_t is set to 0.
Looking at zookeeper.h the zoo_state should return one of the State
constants, but none of this constants is not equal to 0.
So my question is why it is set to 0 and why not to any other declared
constant? In my opinion it should be set to to NOTCONNECTED_STATE_DEF but
unfortunately this is not exported in zookeeper.h.
What do you think about this?
Sorry if this is not a correct mailing list.
Thanks.
Re: C client state goes to 0 - should it?
Posted by Raúl Gutiérrez Segalés <rg...@itevenworks.net>.
On 25 March 2014 05:43, Kuba Lekstan <ku...@gmail.com> wrote:
> Hello,
>
> In destroy (zookeeper.c:401) and handle_error (zookeeper:1236) functions
> the state property of zhandle_t is set to 0.
>
> Looking at zookeeper.h the zoo_state should return one of the State
> constants, but none of this constants is not equal to 0.
>
> So my question is why it is set to 0 and why not to any other declared
> constant? In my opinion it should be set to to NOTCONNECTED_STATE_DEF but
> unfortunately this is not exported in zookeeper.h.
>
> What do you think about this?
>
What bugs could this cause? In both cases you are reaching an unrecoverable
state so your handler is not usable after that point, anyway.
-rgs