Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6A1C99F7 for ; Fri, 18 May 2012 16:19:14 +0000 (UTC) Received: (qmail 46722 invoked by uid 500); 18 May 2012 16:19:14 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 46647 invoked by uid 500); 18 May 2012 16:19:14 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 46638 invoked by uid 99); 18 May 2012 16:19:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 16:19:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of liheyuan.bj@gmail.com designates 209.85.217.170 as permitted sender) Received: from [209.85.217.170] (HELO mail-lb0-f170.google.com) (209.85.217.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2012 16:19:07 +0000 Received: by lbgc1 with SMTP id c1so1457837lbg.15 for ; Fri, 18 May 2012 09:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=JfMLY9SQbs8VYx4+j5GCps4qLWLcxOQRfkWiEEzHhMA=; b=u8i/xrUGUH5ftlaltAOqp2Q4JdlqLfpF+TQcHYzELr6ejD1nDVYW8ZC0ZSb+zVanK8 YNy2Mgi7dfTMv4SPRUD44blJv0f02tzd9Rpdb0NamIfAWPUd/cV7GwXFuR9Hq9a5VKGP QdMpu8nrk6m7paJIl0mO88VQgnh6szy1AsYiHfKb5gP974fDeyWDGeazZZ9Qr/e4eFeo P6JBOvMskfPB4Rf9Zynj4C3UgNKH0Sjv6sBNlcMQLNjeFXxW+eswtO4eZ5JL+TVXtORK 4fQ9dHqOlPVfrYDwUC8LCAli+2pUqqnYaTozQygXLl0I5frBpjvxxmoS3heGd992BQ3q iaog== MIME-Version: 1.0 Received: by 10.112.40.36 with SMTP id u4mr5238544lbk.70.1337357926116; Fri, 18 May 2012 09:18:46 -0700 (PDT) Received: by 10.112.106.131 with HTTP; Fri, 18 May 2012 09:18:46 -0700 (PDT) Date: Sat, 19 May 2012 00:18:46 +0800 Message-ID: Subject: How to recover previous watcher & event after "session expired" From: =?GB2312?B?wO661dSq?= To: user@zookeeper.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, All I'm dealing with the case of "session expired" event. Please help me with the following question. 1. After receive "session expired" event, how to recover the watch that are setting before expired gracefully? 2.Currently, I record the watch setting and call the api to set it again after I got "expired event". It will callback for event after connection was success again. But what about the event happend between I success reinit the session to zk server. Currently, it got lost. Is there any way that I can got these events ? 3.I try to use reconnect, in zookeeper_init, but does't work. My guess is reconnect is only work for connection that are in state connect (Not valid after session timeout), is it right? Thanks for your help !