Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@minotaur.apache.org Received: (qmail 66369 invoked from network); 22 Apr 2010 07:01:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Apr 2010 07:01:08 -0000 Received: (qmail 77270 invoked by uid 500); 22 Apr 2010 07:01:08 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 76986 invoked by uid 500); 22 Apr 2010 07:01:05 -0000 Mailing-List: contact zookeeper-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-user@hadoop.apache.org Delivered-To: mailing list zookeeper-user@hadoop.apache.org Received: (qmail 76978 invoked by uid 99); 22 Apr 2010 07:01:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 07:01:05 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [129.183.4.8] (HELO ecfrec.frec.bull.fr) (129.183.4.8) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 07:00:55 +0000 Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 904ED6F5D3 for ; Thu, 22 Apr 2010 09:00:29 +0200 (CEST) Received: from [129.183.128.80] (frecb015096.frec.bull.fr [129.183.128.80]) by cyclope.frec.bull.fr (Postfix) with ESMTP id 758752728D for ; Thu, 22 Apr 2010 09:00:26 +0200 (CEST) Message-ID: <4BCFF41E.7050600@bull.net> Date: Thu, 22 Apr 2010 09:00:46 +0200 From: Julien Vey User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: zookeeper-user@hadoop.apache.org Subject: Re: Client reconnection after a connection loss References: <4BCEBAF9.9000409@bull.net> <4BCF2440.1000302@apache.org> In-Reply-To: <4BCF2440.1000302@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your help Patrick. I'm already having a look at it. Julien > Hi Julien, > > take a look at the FAQ for some background: > http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A3 > > Basically when your client connects to the server it provides a > "timeout" value. If the server doesn't hear from your client within > this timeout period (we do heartbeating for you in a background > thread, you don't have to worry about this) then it will expire the > session. > http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions > > > You have a watcher for the session - it will be notified both on > disconnect but also when/if the session is expired. An expired session > is invalid, if this happens you have to create a new session. This is > different from a disconnect notification, where you just wait for the > client library to reconnect you to the cluster (say you lose > connectivity to the server) > > Patrick > > On 04/21/2010 01:44 AM, Julien Vey wrote: >> Hi all, >> >> I'm currently working with ZooKeeper in CXF D-OSGI and i'm facing a >> problem that would require your help. >> >> When a client is connected to the ZooKeeper server, and the connection >> is lost, it throws a ConnectionLossException. >> The problem is when the connection is back, the client doesn't reconnect >> itself. I can see the following trace on the server >> >> 2010-04-20 17:44:21,526 - INFO [NIOServerCxn.Factory:> >> 0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] - Accepted socket >> connection from /129.183.128.230:60471 >> 2010-04-20 17:44:21,526 - INFO [NIOServerCxn.Factory: >> 0.0.0.0/0.0.0.0:2181:NIOServerCnxn@742] - Client attempting to renew >> session0x1281ba54e900005 at /129.183.128.230:60471 >> 2010-04-20 17:44:21,527 - INFO [NIOServerCxn.Factory: >> 0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1424] - Invalid session >> 0x1281ba54e900005 for client /129.183.128.230:60471, probably expired >> 2010-04-20 17:44:21,527 - INFO [NIOServerCxn.Factory: >> 0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1286] - Closed socket connection for >> client /129.183.128.230:60471 which had sessionid 0x1281ba54e900005 >> >> The client tries to reconnect with an expired session id. >> Is it possible to configure zookeeper in order that it accepts this >> connection by recreating a new session, or maybe something else that >> would make the reconnection works ? >> >> Thanks in advance for your help >> >> Julien. >> >> >> > >