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 2140318E50 for ; Fri, 28 Aug 2015 22:01:27 +0000 (UTC) Received: (qmail 12743 invoked by uid 500); 28 Aug 2015 22:01:26 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 12684 invoked by uid 500); 28 Aug 2015 22:01:26 -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 12665 invoked by uid 99); 28 Aug 2015 22:01:26 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 22:01:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9E99D1AB0C6 for ; Fri, 28 Aug 2015 22:01:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.003 X-Spam-Level: X-Spam-Status: No, score=-0.003 tagged_above=-999 required=6.31 tests=[RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8nv6zNjqDHSa for ; Fri, 28 Aug 2015 22:01:24 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0111.outbound.protection.outlook.com [157.56.111.111]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 115EB506F1 for ; Fri, 28 Aug 2015 22:01:24 +0000 (UTC) Received: from CY1PR0501MB1644.namprd05.prod.outlook.com (10.161.165.24) by CY1PR0501MB1644.namprd05.prod.outlook.com (10.161.165.24) with Microsoft SMTP Server (TLS) id 15.1.243.23; Fri, 28 Aug 2015 22:01:22 +0000 Received: from CY1PR0501MB1644.namprd05.prod.outlook.com ([10.161.165.24]) by CY1PR0501MB1644.namprd05.prod.outlook.com ([10.161.165.24]) with mapi id 15.01.0243.020; Fri, 28 Aug 2015 22:01:22 +0000 From: Martin Serrano To: "user@zookeeper.apache.org" Subject: Re: How to catch NodeExistsException Thread-Topic: How to catch NodeExistsException Thread-Index: AQHQ4dspSA/m+sDCpUCuB2hJhwzDHw== Date: Fri, 28 Aug 2015 22:01:22 +0000 Message-ID: References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=martin@attivio.com; x-originating-ip: [66.227.116.194] x-microsoft-exchange-diagnostics: 1;CY1PR0501MB1644;5:LTrf3GhOw8cNQRlOjyqMv+yfBcnVd/KnEAvvN3JQM3M4q+4xU4P3jAicqRrYSMIHwAtl0KDC2j6h/rPQ7L6MVDbD+VrD/1WGBech3ok+hizyI6QbvLNwGy9bcwmmW/QnaIYgMywjr+JosBqkUQTlQg==;24:clYBhM11laovx4bHA65iL/c6RKoqd45bY41l5n86b4lmLJnWKAcD/uY1aBX9UB6OUGRdD73nEwecdI3nwoP/Z1LwXKaAXvp7PBu4uchzKCs=;20:4bepHmLk2f0qp/OTATpaIRzx8+0P8FmLJScGtfke1EmCOOKw7+JvmGHij6OZdBozxUq1PNhY0quKuZH1RaJDwA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1644; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(3002001);SRVR:CY1PR0501MB1644;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1644; x-forefront-prvs: 0682FC00E8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(479174004)(199003)(377454003)(189002)(24454002)(97736004)(76576001)(5001830100001)(76176999)(5002640100001)(5001860100001)(4001540100001)(33656002)(81156007)(2351001)(5003600100002)(50986999)(106356001)(74316001)(46102003)(106116001)(107886002)(189998001)(99286002)(77096005)(101416001)(5007970100001)(62966003)(77156002)(110136002)(64706001)(5001960100002)(54356999)(40100003)(2900100001)(2656002)(10400500002)(102836002)(5004730100002)(68736005)(105586002)(86362001)(92566002)(450100001)(2501003)(87936001)(122556002)(66066001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0501MB1644;H:CY1PR0501MB1644.namprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: attivio.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: attivio.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2015 22:01:22.6215 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f2451f17-698f-4d48-b34a-740e2ecaa55e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1644 I find this annoying too. At one point my company was running a custom=0A= zookeeper build that turned those messages to DEBUG on the server. We=0A= did not want to change the logging level because we found the other INFO=0A= messages are useful. The only thing I know to do is to use an existence=0A= check first but this is unfortunate because it requires two calls. =0A= Maybe a multi-op could be used but that seems too complex for such a=0A= common use case.=0A= =0A= -Martin=0A= =0A= On 08/28/2015 05:47 PM, Daniel Kashtan wrote:=0A= > I have this code using Curator:=0A= >=0A= > try=0A= > {=0A= > client.create().forPath(path);=0A= > }=0A= > catch (KeeperException.NodeExistsException ex)=0A= > {=0A= > LOG.debug("caught NodeExistsException");=0A= > }=0A= >=0A= > The trouble is that it is never caught and zookeeper pollutes my producti= on=0A= > logs with what are probably harmless exceptions. I assume that my code=0A= > executes just fine but later on the ZooKeeper server throws the exception= =0A= > as it does work in the background. Is there a way to gracefully catch tho= se=0A= > exceptions so they don't pile up in my production logs?=0A= >=0A= > I have tried in the past to fix my code so these exceptions are never=0A= > thrown, but I have not found much in the documentation or on google on ho= w=0A= > to deal with these exceptions. Is it a known problem? I would love to sol= ve=0A= > these issues too if possible.=0A= >=0A= =0A=