You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Pramod Srinivasan <pr...@juniper.net.INVALID> on 2019/10/14 16:44:11 UTC

Re: Zookeeper C-client API zookeeper_close does not always close the session at server

Hi Folks,

We use Zookeeper 3.5.1-alpha and we are hitting the problem where zookeeper ephemeral nodes does not get cleaned up on zookeeper_close but gets cleaned up after the session timeout. I saw an older email on a similar subject, reopening the conversation.

I suspected that we are hitting https://issues.apache.org/jira/browse/ZOOKEEPER-1105 as the symptoms do indicate that the server is not seeing a CLOSE request.

Do you know if version 3.5.1-alpha is affected by this problem? The jira status is open but is fixed in later versions.

Affects Version/s:
3.3.2, 3.4.3
Fix Version/s:
3.6.0, 3.5.7

One thing I noticed here is that the client does a zookeeper_close() and then a quick_exit(), I expected quick_exit to flush IO, may be it does not and hence we hit the problem?

Thanks,
Pramod
On 4/6/17, 10:26 AM, "Michael Han" <ha...@cloudera.com> wrote:

    >> The documentation for zookeeper_close seems to indicate that the call will
    block until the session is cleaned up at the server or a failure occurs
    
    There is no guarantee that after the call of zookeeper_close the session
    will be cleaned up. Similar for Java client's close as well. ZOK return
    code implies that the close request is sent to server and that's all. If
    you want to make sure ephemeral nodes gets cleaned up then it's better to
    use watchers than relying on return code of the close methods.
    
    On Tue, Apr 4, 2017 at 5:44 PM, svk <sh...@gmail.com> wrote:
    
    > Hi,
    >
    > I am using Zookeeper server ad C-client v3.4.1-alpha.
    >
    > The documentation for zookeeper_close seems to indicate that the call
    > will block until the session is cleaned up at the server or a failure
    > occurs(connection loss, out of memory, timeout etc).
    >
    > However I have observed a couple of times that zookeeper_close returns
    > '0' but the session is not closed at the server - some ephemeral nodes
    > still persist for a while.
    >
    > Looking at the source code for zookeeper_close, I see the condition below:-
    >
    > http://zookeeper.sourcearchive.com/documentation/3.2.2plus-
    > pdfsg3/zookeeper_8h_d739d8cb9288daded58d4cbdede83937.html#
    > d739d8cb9288daded58d4cbdede83937
    >
    > --------------
    >
    > if (inc_ref_counter(zh,0)!=0) {
    >         adaptor_finish(zh);
    >         return ZOK
    > <http://zookeeper.sourcearchive.com/documentation/3.2.2plus-
    > pdfsg3/zookeeper_8h_bb1a0a179f313b2e44ee92369c438a4c.html#
    > bb1a0a179f313b2e44ee92369c438a4c9677bf3e4face8afd292d31ecfd4dc5d>;
    > }
    >
    > ----------------
    > Under what circumstances can this API return ZOK, and yet not succeed in
    > closing the session
    >
    >
    > Thanks,
    > SV
    >
    
    
    
    -- 
    Cheers
    Michael.