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 3209317F3C for ; Wed, 22 Apr 2015 16:03:54 +0000 (UTC) Received: (qmail 47627 invoked by uid 500); 22 Apr 2015 16:03:53 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 47570 invoked by uid 500); 22 Apr 2015 16:03:53 -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 47558 invoked by uid 99); 22 Apr 2015 16:03:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2015 16:03:53 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,SPF_SOFTFAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of hvram1@gmail.com does not designate 54.76.25.247 as permitted sender) Received: from [54.76.25.247] (HELO mx1-eu-west.apache.org) (54.76.25.247) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2015 16:03:27 +0000 Received: from mail-qc0-f175.google.com (mail-qc0-f175.google.com [209.85.216.175]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 4EC94203A1 for ; Wed, 22 Apr 2015 16:03:26 +0000 (UTC) Received: by qcrf4 with SMTP id f4so95460591qcr.0 for ; Wed, 22 Apr 2015 09:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Bd625eGmI2yQmGeaYQKUgkn7rZSGSopBfH/uHxAKhEE=; b=yawHiku3FzmHF0Dwn3zEA1PaXYrWFcPx3P+HsuOQ0HoGihjoSnIyeBl+ZASFy1lXA7 kv8nH7QsDNjuNYjjg99CKuda7ekb10Jt9Cl+6WnqZ6kamnesSIG9EO6RyiZWfRj4l9Ny 78EqaA2J9Jean06cdx8JbKBKbEP9dBat/rS8D4Hahf42T2iEdW/oltM0+JwBU1JC68xP 9cm0d0XXkE5hTLFTUWI5FeGvKZteOm3NFM4IgMctKtDHnpq5GPIgvdX47drbIklufoeR TXELMvvOTRDQHFEt2MhQkOX9TgD/FiOlQHhrH0RRVfnoG3aVQzTC4EgQcEXfVL790uFu +uog== MIME-Version: 1.0 X-Received: by 10.229.247.10 with SMTP id ma10mr31578495qcb.30.1429718605155; Wed, 22 Apr 2015 09:03:25 -0700 (PDT) Received: by 10.140.85.50 with HTTP; Wed, 22 Apr 2015 09:03:25 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Apr 2015 21:33:25 +0530 Message-ID: Subject: Re: Intermittent connection loss error From: Harihara Vinayakaram To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001a1134a5e696f0070514524d27 X-Virus-Checked: Checked by ClamAV on apache.org --001a1134a5e696f0070514524d27 Content-Type: text/plain; charset=UTF-8 Are u running on a VM ? VMWare VM's have a nasty habit of changing times --Hari On Tue, Apr 21, 2015 at 8:13 PM, Lahiru Ginnaliya Gamathige < glahiru@gmail.com> wrote: > Hi Devs, > > We are using ZK in Apache Airavata and when we run it for sometime some > connections are get lost and never get reconnect. I get following error and > since I try to reconnect in my process method it keeps trying and exhaust > the log. Of course I can fix the log issue but I am not sure why this is > happening . I am using ZK in standalone mode just single instance and below > is the code I use to reconnect and the log. > > 2015-04-08 09:43:10,785 [main-SendThread(gw111.iu.xsede.org:2181)] WARN > org.apache.zookeeper.ClientCnxn - Session 0x0 for server > gw111.iu.xsede.org/149.165.228.109:2181, unexpected error, closing socket > connection and attempting reconnect > java.io.IOException: Connection reset by peer > at sun.nio.ch.FileDispatcherImpl.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) > at sun.nio.ch.IOUtil.read(IOUtil.java:192) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) > at > org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:66) > at > > org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:291) > at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1041) > > > @Override > synchronized public void process(WatchedEvent watchedEvent) { > logger.info(watchedEvent.getPath()); > synchronized (mutex) { > Event.KeeperState state = watchedEvent.getState(); > logger.info(state.name()); > switch(state){ > case SyncConnected: > mutex.notify(); > case Expired:case Disconnected: > try { > mutex = -1; > zk = new > ZooKeeper(AiravataZKUtils.getZKhostPort(), > AiravataZKUtils.getZKTimeout(), this); > synchronized (mutex) { > mutex.wait(); // waiting for the syncConnected > event > } > storeServerConfig(); > } catch (IOException e) { > logger.error("Error while synchronizing with > zookeeper", e); > } catch (ApplicationSettingsException e) { > logger.error("Error while synchronizing with > zookeeper", e); > } catch (InterruptedException e) { > logger.error("Error while synchronizing with > zookeeper", e); > } catch (AiravataSystemException e) { > logger.error("Error while synchronizing with > zookeeper", e); > } > } > } > } > > > Lahiru > > > -- > Research Assistant > Science Gateways Group > Indiana University > --001a1134a5e696f0070514524d27--