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 F373479B1 for ; Thu, 8 Sep 2011 10:56:33 +0000 (UTC) Received: (qmail 33070 invoked by uid 500); 8 Sep 2011 10:56:32 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 32646 invoked by uid 500); 8 Sep 2011 10:56:19 -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 32621 invoked by uid 99); 8 Sep 2011 10:56:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2011 10:56:16 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,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 isaac.198@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2011 10:56:10 +0000 Received: by gwb20 with SMTP id 20so813693gwb.17 for ; Thu, 08 Sep 2011 03:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oQ3IUh8vNDlDFteLvWPWYjH+5KpQP/5i/7syYpV1frE=; b=iRySxzu95ouAH7nOn17N65+rcMTVMSkiTdzEOEfYDjSAPx5BWko8D34PsbbWCnmgvZ iWSwzUEVSwNW+Kvb8eiuvlgMnlXV+jfgIgmIr8nEfxeub/B0QYbTYhG9tG+lkZ65G7YR PgquxE4ls5KaMtNjWj5bRLeNQJLwcGSBVceF4= MIME-Version: 1.0 Received: by 10.150.135.8 with SMTP id i8mr727758ybd.109.1315479349581; Thu, 08 Sep 2011 03:55:49 -0700 (PDT) Received: by 10.150.220.16 with HTTP; Thu, 8 Sep 2011 03:55:49 -0700 (PDT) In-Reply-To: References: Date: Thu, 8 Sep 2011 18:55:49 +0800 Message-ID: Subject: Re: zookeeper connection loss exception occurs on new created ZooKeeper instance too much,why? From: Isaac To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=000e0cd59cdc57586e04ac6be7d6 --000e0cd59cdc57586e04ac6be7d6 Content-Type: text/plain; charset=UTF-8 oh,i see. thanks for help. :) On Wed, Sep 7, 2011 at 3:58 PM, Mahadev Konar wrote: > Isaac, > You should wait for the state to be connected before issuing the requests. > > Take a look at the javadoc: > > http://bit.ly/oC6TEb > > hope that helps > mahadev > > > On Wed, Sep 7, 2011 at 12:48 AM, Isaac wrote: > > oh, i found this, operate on a zookeeper in status CONNECTING will throw > a > > ConnectionLossException. > > maybe that's the problem. > > example: > > [zk: 172.27.1.1:8082(CONNECTING) 1] ls / > > Exception in thread "main" org.apache.zookeeper.KeeperException$ > > ConnectionLossException: KeeperErrorCode = ConnectionLoss for / > > at > > org.apache.zookeeper.KeeperException.create(KeeperException.java:90) > > at > > org.apache.zookeeper.KeeperException.create(KeeperException.java:42) > > at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1243) > > at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1271) > > at > > org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:700) > > at > > org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:581) > > at > > org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:353) > > at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:311) > > at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:270) > > > > On Wed, Sep 7, 2011 at 3:32 PM, Isaac wrote: > > > >> zookeeper connection loss exception occurs on new created ZooKeeper > >> instance too much > >> > >> code like this: > >> ZooKeeper zk = new ZooKeeper(connectString, 3000, defaultWatcher); > >> zk.exists("/"); //connection loss exception occurs here sometimes. > >> > >> any one knows why? > >> > >> > >> > > > --000e0cd59cdc57586e04ac6be7d6--