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 0220E7160 for ; Sat, 16 Jul 2011 08:45:19 +0000 (UTC) Received: (qmail 52345 invoked by uid 500); 16 Jul 2011 08:45:18 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 51809 invoked by uid 500); 16 Jul 2011 08:44:57 -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 51799 invoked by uid 99); 16 Jul 2011 08:44:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 08:44:53 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of teddyyyy123@gmail.com designates 209.85.213.170 as permitted sender) Received: from [209.85.213.170] (HELO mail-yx0-f170.google.com) (209.85.213.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 08:44:46 +0000 Received: by yxk8 with SMTP id 8so913435yxk.15 for ; Sat, 16 Jul 2011 01:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=jd8oaHYsVGr1B6ZbhU1e6mxEwRAYEWYvgKgaFDw2JiI=; b=bAgiCyVB6tNkAJ2NDDRUn5+fzydfkNjwu+hXvW4u7U3YItKAzT+rcYo+TXh5EvyH25 36egRqIFJrUdAGxilgNoQXXL8LXOvT85vLqVM5L/517N4bAQaCzFKQ8+gwgwmvKHTipP myraiFB2mcy80+SDC9V2aLdpYzQmdTuLX5KMU= MIME-Version: 1.0 Received: by 10.236.170.67 with SMTP id o43mr5125846yhl.141.1310805865867; Sat, 16 Jul 2011 01:44:25 -0700 (PDT) Received: by 10.236.202.166 with HTTP; Sat, 16 Jul 2011 01:44:25 -0700 (PDT) Date: Sat, 16 Jul 2011 01:44:25 -0700 Message-ID: Subject: help on Zookeeper code walk through? From: Yang To: user@zookeeper.apache.org Content-Type: text/plain; charset=ISO-8859-1 I'm wondering if a client loses session to its ephemeral znode, under the hood, how is the watcher triggered? went through the code , and found something that looks related: ZKDataBase.killSession()-->DataTree.killSession()--->DataTree.deleteNode()--->WatchManager.triggerWatch()--->Watcher.process() but how is ZKDataBase.killSession() called? from the info given in http://zookeeper.apache.org/doc/r3.3.3/zookeeperProgrammers.html#ch_zkSessions I can see the ZooKeeper client code does periodically ping the server to maintain liveness. but how the server checks for this liveness and trigger killSession(), here I'm having difficulty connecting the dots. could you please give me some help walking through this piece of code? Thanks Yang