zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Xu <mx2...@gmail.com>
Subject c client "0" state?
Date Fri, 17 Sep 2010 16:10:06 GMT
Hi everyone

in the c client api:

Is it normal for zoo_state() to return zero (not one of the valid state
consts) when it is handling socket errors?

In the C Code, handle_error(), which handles socket errors,  sets the
zh->state to zero, 
    if (!is_unrecoverable(zh))  
        zh->state = 0;

If the handle is recoverable, why is the state set to zero, which is not
even a valid state const? 

Here's a use case where the state should be connecting, but instead is

1) c client connects to a zkserver
2) shutdown zkserver
3) zoo_state() returns zero on a valid zookeeper handle. 

We are using zoo_state() to get the state of the connection, and this is
a surprising returned value from this function.



View raw message