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 DB35711821 for ; Mon, 24 Mar 2014 17:00:24 +0000 (UTC) Received: (qmail 3074 invoked by uid 500); 24 Mar 2014 17:00:23 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 3000 invoked by uid 500); 24 Mar 2014 17:00:22 -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 2991 invoked by uid 99); 24 Mar 2014 17:00:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2014 17:00:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cf@renttherunway.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-la0-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2014 17:00:16 +0000 Received: by mail-la0-f48.google.com with SMTP id gf5so3885939lab.35 for ; Mon, 24 Mar 2014 09:59:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=xX0dA5jn4i6horeN2zLW6ncN+8emiuP75f7saqFWZiY=; b=WLDa4p2BrPx+M1N3Js4ybKZ6M8h3NP1POqa3ITB+Pf4VO/5beVKb4xjLtp10pwR266 zBtuTpwPTfFAbsMm3AXnVDt/Ph/lBq9nXrmZBoVLmK6bscxqkAJ2Ijw6jSAzA9WfPZun BRN/+kSSmdRPJVzXmByM/rrWD0hpgba4fo51y5StRgw4cwxNko8m8DRhpBmcHLHlx591 Q13ujM9N/nQlDdGeQjVyRtpVZUEnsL8bE3WCqnb+gAtYbD8UBdldfFDhshRsjZUsB6ns fB/cKtO+qtAez+k2sr/IW7fysrO/B1r9D3s/bDOqRzzZlSf6DBdrImGz2D2zEvmcdnOg 109g== X-Gm-Message-State: ALoCoQnr3om6kfuFX1dLCa5IqIaV7NNPYKwX30ykdQNxotOOhXCx6fd3xq7krjtAlqgNcMSjF9EX MIME-Version: 1.0 X-Received: by 10.112.97.178 with SMTP id eb18mr43733474lbb.13.1395680394675; Mon, 24 Mar 2014 09:59:54 -0700 (PDT) Sender: cf@renttherunway.com Received: by 10.112.120.132 with HTTP; Mon, 24 Mar 2014 09:59:54 -0700 (PDT) In-Reply-To: <533061DA.1090706@victorops.com> References: <533056C1.6050906@victorops.com> <533061DA.1090706@victorops.com> Date: Mon, 24 Mar 2014 12:59:54 -0400 X-Google-Sender-Auth: 05AuHQzY2yLbw5Ofv3T8MVi_9NE Message-ID: Subject: Re: Basic client question From: Camille Fournier To: "bookkeeper-user@zookeeper.apache.org" Content-Type: multipart/alternative; boundary=001a1133e30825199b04f55d2ab7 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133e30825199b04f55d2ab7 Content-Type: text/plain; charset=ISO-8859-1 There is a connect timeout set automatically in the client based on the session timeout divided by the number of servers in the cluster. You will see a SessionTimeout exception if you exceed this connect timeout without successfully connecting to one of the servers. I would recommend using a higher-level client than the one that ships with ZooKeeper, or else you have to build all of this in. Even if you want to build your own, it would probably be useful reading the documentation for something like Curator, which explains the choices that client made to do this: http://curator.apache.org/curator-client/index.html On Mon, Mar 24, 2014 at 12:48 PM, Dan Hopkins wrote: > Camille, > I'm trying to figure out what timeout you're referring to? I'm using > zkClient that ships with ZooKeeper and the only timeout I can see to > configure is the "session timeout." Does this timeout work even if you > never hear back from any server? > > Thanks, > Dan > > > On 03/24/2014 10:31 AM, Camille Fournier wrote: > >> So, client will never be able to reach the server again? The client that >> you use (and we generally recommend you use an existing client library >> like >> Curator or even zkClient instead of writing your own) should have some >> sort >> of timeout configured so that if it gets disconnected and can't reach the >> server within some period of time it gives up. >> >> C >> >> >> On Mon, Mar 24, 2014 at 12:01 PM, Dan Hopkins >> wrote: >> >> As a beginner using zookeeper I was wondering if anyone could help me >>> understand how the java ZooKeeper client handles a permanent disconnect >>> from the cluster. I'm curious because as I read the FAQ we can get a >>> Session expiration if we ever connect to the server but I'm not sure what >>> to do if I can never connect again. >>> >>> Is there a different exception thrown after a the client has detected >>> permanent failure? >>> >>> I'm currently using Zk 3.3.4 in case the behavior has changed. >>> >>> Thanks for any pointers, >>> Dan >>> >>> -- >>> Dan Hopkins | Programmer >>> e: danhopkins@victorops.com >>> >>> Be Victorious >>> >>> >>> > -- > Dan Hopkins | Programmer > e: danhopkins@victorops.com > > Be Victorious > > --001a1133e30825199b04f55d2ab7--