Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-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 E856D187BD for ; Tue, 16 Jun 2015 20:08:32 +0000 (UTC) Received: (qmail 80304 invoked by uid 500); 16 Jun 2015 20:08:30 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 80233 invoked by uid 500); 16 Jun 2015 20:08:30 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 80222 invoked by uid 99); 16 Jun 2015 20:08:30 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2015 20:08:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 98535CE447 for ; Tue, 16 Jun 2015 20:08:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.999 X-Spam-Level: *** X-Spam-Status: No, score=3.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LIVE=1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id NXRT7Rt7Q2WJ for ; Tue, 16 Jun 2015 20:08:22 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 10F0843AC7 for ; Tue, 16 Jun 2015 20:08:22 +0000 (UTC) Received: by igbiq7 with SMTP id iq7so51528196igb.1 for ; Tue, 16 Jun 2015 13:08:21 -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:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=nJdTnjD5RASmRkptHn6Ac/CMrSv5eo2TUAT4r9eaSuw=; b=jRDEQ4QNc90ETNDfYt77pUHT7KMajDyctHnc2+izPP3a251EpkJLnlZqXSqC18w1tK jqUr9Hs8e9xHGySU3LiZaZhTTax0eFzQHmENp8L5OAOS/RC37zcWbQiBsRkBcGi4VCvZ aoa3/9hEDlhF1/kO6U76oUkZuG6+1uR2SLVPrGsRlt2MNApbo+VdPjijkFwGGj/5mCEI OUtMqJ4nooWuuaMBbkSkHe/XFzLorStxdhJz5Q/uPLwM275H0bGuNFGHeNzd/B2shK7I /oM70UVtexXr4aduOugtmCJfLEB5hKyz+iZVNYA0dICkqg55uPvH295i4g8Ha8yrFKxK F8DQ== X-Gm-Message-State: ALoCoQlvxUW+RmO0XAbD761uJt6XU0v8HYn2EWHuTTOuoA3nOaGb3iVGCUcYSTJNUWXkoo1hSnta X-Received: by 10.107.128.227 with SMTP id k96mr2897901ioi.7.1434485301670; Tue, 16 Jun 2015 13:08:21 -0700 (PDT) MIME-Version: 1.0 References: <1577500411.4316224.1434438809398.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: From: Bryan Beaudreault Date: Tue, 16 Jun 2015 20:08:10 +0000 Message-ID: Subject: Re: How to make the client fast fail To: user@hbase.apache.org, lars hofhansl Content-Type: multipart/alternative; boundary=001a113f8e42d78e640518a822fd --001a113f8e42d78e640518a822fd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I agree that more documentation would be better. However, > Yet, there are some applications which require a faster time out than > others. So, you tune some of the timers to have a fast fail, and you end = up > causing unintended problems for others. > > The simplest solution is to use threads in you client app. (Of course thi= s > assumes that you=E2=80=99re capable of writing clean multi-threaded code = and I > don=E2=80=99t want to assume anything.) > > Remember that HBase is a shared resource. So you need to consider the > whole at the same time you consider the needs of one. > > This is not really true, it assumes a very naive configuration solution in which all processes are configured the same. The default configs come from xml files, but are easily customized. Consider: Application A: Configuration conf =3D HBaseConfiguration.create(); conf.setInt("hbase.rpc.timeout", 8000); // Operations on table have a timeout of 8s Connection conn =3D ConnectionFactory.createConnection(conf); conn.getTable("foo"); Application B: // Operations on this table use default timeout Connection conn =3D ConnectionFactory.createConnection(HBaseConfiguration.create()); conn.getTable("foo"); // Operations on this table use a very short timeout of 500ms Configuration conf =3D HBaseConfiguration.create(); conf.setInt("hbase.rpc.timeout", 500); Connection shortConn =3D ConnectionFactory.createConnection(conf); short shortConn.getTable("foo"); Applications A and B are configured with different timeouts. Further, Application B has two separate table connections, each with a different timeout. The values are hardcoded above, but could easily be made configurable. The simplest of solutions uses System.getProperty(), so you can pass -Dmy.custom.timeout=3D500. More complex solutions can utilize the various open source live configuration solutions. Such as netflix archaius, or hubspot's live-config -- both available on github. Of course there can be unintended consequences if an application suddenly > starts to drop connections before a result or timeout occurs too. ;-) > > > > On Jun 16, 2015, at 12:13 AM, lars hofhansl wrote: > > > > Please always tell us which version of HBase you are using. We have > fixed a lot of issues in this area over time.Here's an _old_ blog post I > wrote about this: > http://hadoop-hbase.blogspot.com/2012/09/hbase-client-timeouts.html > > > > Using yet more threads to monitor timeouts of another thread is a bad > idea, especially when the timeout is configurable in the first place. > > > > -- Lars > > From: mukund murrali > > To: user@hbase.apache.org > > Sent: Sunday, June 14, 2015 10:22 PM > > Subject: Re: How to make the client fast fail > > > > It would be great if there is a single timeout configuration from the > > client end. All other parameters should fine tune based on that one > > parameter. We have modified simple based on trail basis to suit our nee= d. > > Also not sure what side effect it would cause configuring those > parameters. > > > > > > > > On Mon, Jun 15, 2015 at 10:38 AM, wrote= : > > > >> We are also interested on the solution for this. With > >> hbase.client.retries.number =3D 7 and client.pause=3D400ms, it came do= wn to > >> ~9mins (from 20 mins). Now we are thinking the 9mins is also a big > number. > >> > >> Thanks, > >> Hari > >> > >> -----Original Message----- > >> From: PRANEESH KUMAR [mailto:praneesh.sankar@gmail.com] > >> Sent: Monday, June 15, 2015 10:33 AM > >> To: user@hbase.apache.org > >> Subject: Re: How to make the client fast fail > >> > >> Hi Michael, > >> > >> We can have a monitoring thread and interrupt the hbase client thread > >> after time out instead of doing this I want the timeout or some > exception > >> to be thrown from the HBase client itself. > >> > >> On Thu, Jun 11, 2015 at 5:16 AM, Michael Segel > >> wrote: > >> > >>> threads? > >>> > >>> So that regardless of your hadoop settings, if you want something > >>> faster, you can use one thread for a timer and then the request is in > >>> another. So if you hit your timeout before you get a response, you ca= n > >> stop your thread. > >>> (YMMV depending on side effects... ) > >>> > >>>> On Jun 10, 2015, at 12:55 AM, PRANEESH KUMAR > >>>> > >>> wrote: > >>>> > >>>> Hi, > >>>> > >>>> I have got the Connection object with default configuration, if the > >>>> zookeeper or HMaster or Region server is down, the client didn't > >>>> fast > >>> fail > >>>> and it took almost 20 mins to thrown an error. > >>>> > >>>> What is the best configuration to make the client fast fail. > >>>> > >>>> Also what is significance of changing the following parameters. > >>>> > >>>> hbase.client.retries.number > >>>> zookeeper.recovery.retry > >>>> zookeeper.session.timeout > >>>> zookeeper.recovery.retry.intervalmill > >>>> hbase.rpc.timeout > >>>> > >>>> Regards, > >>>> Praneesh > >>> > >>> > >> > > > > > > --001a113f8e42d78e640518a822fd--