Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 57910 invoked from network); 15 Jul 2009 15:22:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jul 2009 15:22:29 -0000 Received: (qmail 97409 invoked by uid 500); 15 Jul 2009 15:22:39 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 97371 invoked by uid 500); 15 Jul 2009 15:22:39 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 97361 invoked by uid 99); 15 Jul 2009 15:22:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 15:22:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 15:22:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C3FAB234C004 for ; Wed, 15 Jul 2009 08:22:14 -0700 (PDT) Message-ID: <983530136.1247671334788.JavaMail.jira@brutus> Date: Wed, 15 Jul 2009 08:22:14 -0700 (PDT) From: "Jonathan Gray (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-1604) HBaseClient.getConnection() may return a broken connection without throwing an exception In-Reply-To: <573340230.1246536227896.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-1604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731506#action_12731506 ] Jonathan Gray commented on HBASE-1604: -------------------------------------- Eugene, can you provide a patch? > HBaseClient.getConnection() may return a broken connection without throwing an exception > ---------------------------------------------------------------------------------------- > > Key: HBASE-1604 > URL: https://issues.apache.org/jira/browse/HBASE-1604 > Project: Hadoop HBase > Issue Type: Bug > Components: client > Affects Versions: 0.19.2 > Reporter: Eugene Kirpichov > > Consider the code of HBaseClient.getConnection(): > {code} > connection.setupIOstreams(); > return connection; > } > {code} > Now consider the setupIOstreams() method: > {code} > } catch (IOException e) { > markClosed(e); > close(); // Removes the connection from pool > } > {code} > So, if something goes wrong inside of setupIOstreams, then after its invocation the connection will be broken (will have its .in and .out streams nulls, for example) and will not be in pool, but will still be returned from the getConnection method and cause further harm (for example, cause a NullPointerException in further calls such as sendCall, which use the in and out streams). > Suggested fix: make the setupIOstreams method rethrow the IOException inside that catch block. > Reproduction: Restart the hbase master and/or regionserver while a client program is running, and put a breakpoint into that catch block. > I actually observed a situation where the broken connection stayed in the pool, but I don't yet know how to reproduce it or what is the reason. I am investigating the issue, but for now at least the aforementioned bug should be fixed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.