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 0A8D2C45D for ; Fri, 16 Jan 2015 02:34:03 +0000 (UTC) Received: (qmail 90726 invoked by uid 500); 16 Jan 2015 02:34:04 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 90680 invoked by uid 500); 16 Jan 2015 02:34:04 -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 90583 invoked by uid 99); 16 Jan 2015 02:34:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jan 2015 02:34:02 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of barlock@us.ibm.com designates 32.97.110.151 as permitted sender) Received: from [32.97.110.151] (HELO e33.co.us.ibm.com) (32.97.110.151) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jan 2015 02:33:55 +0000 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Jan 2015 19:33:05 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Jan 2015 19:33:03 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id D68313E40044 for ; Thu, 15 Jan 2015 19:26:13 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0G2X2YC35323930 for ; Thu, 15 Jan 2015 19:33:02 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0G2X2bg021486 for ; Thu, 15 Jan 2015 19:33:02 -0700 Received: from d03nm119.boulder.ibm.com (d03nm119.boulder.ibm.com [9.63.40.225]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t0G2X2oh021480 for ; Thu, 15 Jan 2015 19:33:02 -0700 In-Reply-To: References: To: user@zookeeper.apache.org MIME-Version: 1.0 Subject: Re: ConnectionLossException X-KeepSent: C5908320:96C788F0-85257DCF:000D381C; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP2 SHF37 August 25, 2014 From: Chris Barlock Message-ID: Date: Thu, 15 Jan 2015 21:33:01 -0500 X-MIMETrack: Serialize by Router on D03NM119/03/M/IBM(Release 9.0.1FP1|April 03, 2014) at 01/15/2015 19:33:01, Serialize complete at 01/15/2015 19:33:01 Content-Type: multipart/alternative; boundary="=_alternative 000E035385257DCF_=" X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15011602-0009-0000-0000-000008071D25 X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 000E035385257DCF_= Content-Type: text/plain; charset="US-ASCII" Michi: By "client log" I assume you mean my product's log. I'll have to add some additional logging to indicate when it thinks it is connected -- or not. An excellent suggestion! Will work on that in the morning. (It generally does connect because most/all of the configuration data I put in ZooKeeper is there. (I say "most/all" because I haven't verified every single config attribute.) Thanks! Chris From: Michi Mutsuzaki To: "user@zookeeper.apache.org" Date: 01/15/2015 09:21 PM Subject: Re: ConnectionLossException Sent by: mutsuzaki@gmail.com Hi Chris, >From your code snippet, It is possible that the client didn't get connected to ZooKeeper at all. Could you paste the entire client log? Do you see any log message that indicates that the client got connected to ZooKeeper? On Thu, Jan 15, 2015 at 6:04 PM, Chris Barlock wrote: > We are currently using ZK 3.3.4, which is included in the version of Kafka > we are using. I'm seeing a number of exceptions like: > > org.apache.zookeeper.KeeperException$ConnectionLossException: > KeeperErrorCode = ConnectionLoss for /com > at > org.apache.zookeeper.KeeperException.create(KeeperException.java:90) > at > org.apache.zookeeper.KeeperException.create(KeeperException.java:42) > at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815) > at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:843) > at > com.ibm.tivoli.ccm.config.rest.ConfigClient.setValueAtNode(ConfigClient.java:630) > > My method setValueAtNode includes a call to this method before I make any > zk (ZooKeeper) calls: > > private void connectZooKeeper() { > final String methodName = "connectZooKeeper"; > trace.entry(CLASS_NAME, methodName); > > if (zk == null || zk.getState() != States.CONNECTED) { > if (zk != null) { > close(); > } > try { > zk = new ZooKeeper(connectString, sessionTimeout, this); > int connectAttempts = 0; > while (zk.getState() != States.CONNECTED && > connectAttempts < MAX_ZK_CONNECT_ATTEMPTS) { > try { > Thread.sleep(ZK_CONNECT_WAIT); > } catch (InterruptedException e) { > // Ignore > } > connectAttempts++; > } > } catch (IOException e) { > trace.exception(CLASS_NAME, methodName, e); > } > } > > trace.exit(CLASS_NAME, methodName); > } > > I'm totally guessing that the connection is timing out between the time > this method is called and when I make the following zk method calls. Is > there a best practise for ensuring one is connected to ZooKeeper? My > session timeout is 3000 ms. > > Chris --=_alternative 000E035385257DCF_=--