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 2309B10143 for ; Mon, 28 Apr 2014 19:03:40 +0000 (UTC) Received: (qmail 48441 invoked by uid 500); 28 Apr 2014 19:03:38 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 48111 invoked by uid 500); 28 Apr 2014 19:03:38 -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 47969 invoked by uid 500); 28 Apr 2014 19:03:37 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org Received: (qmail 47845 invoked by uid 99); 28 Apr 2014 19:03:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2014 19:03:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.192.178] (HELO mail-pd0-f178.google.com) (209.85.192.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2014 19:03:32 +0000 Received: by mail-pd0-f178.google.com with SMTP id fp1so3888128pdb.23 for ; Mon, 28 Apr 2014 12:03:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:content-type; bh=HDIbxkjdGo/0ZIp3//NEYZLGaUzqhAT8ngeLGCTBjqE=; b=H1qYXQ5QpN67Py5FwGJpC60lgaLxsGtufkZZYoJP42fF8ixxef36QQa95Eb4C/hEgZ yQEVQWd2j3rKlsdBWmfGZxwH+AD5d1cUrqYd1M7cYARUNP2kSQoRlf+4lHLwg9AU8H6v Z1cUOtodLvzYE3OovCPPaY6mHTpQZAU3jmiPzhur5xvJe0//P7T9ZkjBzAeefL1+NYuv faH2jac4gCrfm+NSby/BMg0DrDfdoI5TQNZ6Nvrxaren9D2XGezR7a+qPa4Fg7YMt6AV CCogWjIUNAXmjLEUOWfBVB1jJVCVS/Ll7N++9mLPjCo5nLJOOSv2oSTI5nhX29dwEYpm Oq4g== X-Gm-Message-State: ALoCoQniZnNMwT+7Z8QLHB5qCj/OfFINbsrZ0zLi0uyASWv/6K+35pBog2douvkCHUlI+I7zuFpw X-Received: by 10.68.189.68 with SMTP id gg4mr30967884pbc.42.1398711789136; Mon, 28 Apr 2014 12:03:09 -0700 (PDT) Received: from tw-172-25-137-202.office.twttr.net ([8.25.197.25]) by mx.google.com with ESMTPSA id ky8sm36610789pbc.64.2014.04.28.12.03.07 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 12:03:07 -0700 (PDT) Date: Mon, 28 Apr 2014 12:03:01 -0700 From: Yan Xu To: Asad Saeed , user@zookeeper.apache.org Cc: "=?utf-8?Q?zookeeper-user=40hadoop.apache.org?=" Message-ID: In-Reply-To: <42359CA7-7466-4414-A91D-E64E034F546B@scalecomputing.com> References: <42359CA7-7466-4414-A91D-E64E034F546B@scalecomputing.com> Subject: Re: Zookeeper C client fail to deliver a session event X-Mailer: Airmail (237) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="535ea5eb_327b23c6_1c0" X-Virus-Checked: Checked by ClamAV on apache.org --535ea5eb_327b23c6_1c0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks Asad,=C2=A0 I wasn=E2=80=99t expecting a session expiration but indeed ZK=5FCONNECTIN= G=5FSTATE, just didn=E2=80=99t seem to have received one. Yan =46rom:=C2=A0Asad Saeed asaeed=40scalecomputing.com Reply:=C2=A0user=40zookeeper.apache.org user=40zookeeper.apache.org Date:=C2=A0April 25, 2014 at 11:01:41 PM To:=C2=A0user=40zookeeper.apache.org user=40zookeeper.apache.org Cc:=C2=A0zookeeper-user=40hadoop.apache.org zookeeper-user=40hadoop.apach= e.org Subject:=C2=A0 Re: Zookeeper C client fail to deliver a session event =20 Yan, =20 According to your logs you did not have a session expire, but your connec= tion was lost. You should have received a session event stating ZK=5FCONN= ECTING=5FSTATE, when the client detected it had disconnected. =20 I have wrapped this functionality in our own implementation of the client= . When we get this event we create timer that will trigger a expiry unles= s ZK=5FCONNECTED state occurs within the expected duration of the expecte= d session. =20 The c client will only trigger ZK=5FEXPIRED=5FSESSION=5FSTATE, if on reco= nnect the server states that the session provided is expired. =20 Asad =20 On Apr 25, 2014, at 1:20 PM, Ra=C3=BAl Guti=C3=A9rrez Segal=C3=A9s wrote: =20 > On 25 April 2014 11:18, Ra=C3=BAl Guti=C3=A9rrez Segal=C3=A9s wrote: =20 > =20 >> On 25 April 2014 10:15, Yan Xu wrote: =20 >> =20 >>> Hi zookeeper-user, =20 >>> =20 >>> When I was triaging an issue with my ZK wrapper I think I found that = =20 >>> during =20 >>> disconnection ZK client has failed to deliver the session event to th= e =20 >>> watcher (but logged it). =20 >>> =20 >>> The log shows: =20 >>> =20 >>> 2014-04-23 23:50:30,324:990(0x7f75d4ba9940):ZOO=5FIN=46O=40check=5Fev= ents=401703: =20 >>> initiated connection to server =5B<...>:2181=5D =20 >>> 2014-04-23 23:50:31,603:990(0x7f75d4ba9940):ZOO=5FIN=46O=40check=5Fev= ents=401750: =20 >>> session establishment complete on server =5B<...>:2181=5D, =20 >>> sessionId=3D0x2456db1b7d32534, negotiated timeout=3D10000 =20 >>> ... =20 >>> 2014-04-23 =20 >>> 23:50:38,925:990(0x7f75d4ba9940):ZOO=5FERROR=40handle=5Fsocket=5Ferro= r=5Fmsg=401643: =20 >>> Socket =5B<...>:2181=5D zk retcode=3D-7, errno=3D110(Connection timed= out): =20 >>> connection to <...>:2181 timed out (exceeded timeout by 636ms) =20 >>> 2014-04-23 23:50:38,925:990(0x7f75d4ba9940):ZOO=5FWARN=40zookeeper=5F= interest =20 >>> =401557: =20 >>> Exceeded deadline by 1842ms =20 >>> 2014-04-23 23:50:38,925:990(0x7f75d4ba9940):ZOO=5FIN=46O=40check=5Fev= ents=401703: =20 >>> initiated connection to server =5B<...>:2181=5D =20 >>> 2014-04-23 23:50:38,927:990(0x7f75d4ba9940):ZOO=5FIN=46O=40check=5Fev= ents=401750: =20 >>> session establishment complete on server =5B<...>:2181=5D, =20 >>> sessionId=3D0x2456db1b7d32534, negotiated timeout=3D10000 =20 >>> =20 >> =20 >>> which indicates that ZK client state transitioned from CONNECTED -> =20 >>> CONNECTING -> CONNECTED. =20 >>> =20 >>> But my wrapper code was expecting a watcher event with ZOO=5FSESSION=5F= EVENT & =20 >>> ZOO=5FCONNECTING=5FSTATE but never got one. =20 >>> The events for the CONNECTED state before and after the disconnection= were =20 >>> delivered. =20 >>> =20 >>> =20 >> Was auth performed in the missing parts of the log=3F If so I guess yo= u =20 >> could take the first branch here: =20 >> =20 >> =20 >> https://github.com/apache/zookeeper/blob/branch-3.4/src/c/src/zookeepe= r.c=23L1224 =20 >> =20 >> thus not missing the PROCESS=5FSESSION=5FEVENT(zh, ZOO=5FCONNECTING=5F= STATE) call. =20 >> =20 > =20 > Meant =22thus missing=22. Lack of coffee :-) =20 > =20 > I wonder if this could happen when you have an AUTH packet in-flight. =20 > =20 > =20 > -rgs =20 --535ea5eb_327b23c6_1c0--