Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20ECC10F52 for ; Tue, 17 Dec 2013 07:56:11 +0000 (UTC) Received: (qmail 75903 invoked by uid 500); 17 Dec 2013 07:56:10 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 75251 invoked by uid 500); 17 Dec 2013 07:56:08 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 74966 invoked by uid 99); 17 Dec 2013 07:56:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Dec 2013 07:56:07 +0000 Date: Tue, 17 Dec 2013 07:56:07 +0000 (UTC) From: "Samarth (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HBASE-10185) HBaseClient retries even though a DoNotRetryException was thrown MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Samarth created HBASE-10185: ------------------------------- Summary: HBaseClient retries even though a DoNotRetryException was thrown Key: HBASE-10185 URL: https://issues.apache.org/jira/browse/HBASE-10185 Project: HBase Issue Type: Bug Components: IPC/RPC Affects Versions: 0.94.12 Reporter: Samarth Throwing a DoNotRetryIOException inside Writable.write(Dataoutput) method doesn't prevent HBase from retrying. Debugging the code locally, I figured that the bug lies in the way HBaseClient simply throws an IOException when it sees that a connection has been closed unexpectedly. Method: public Writable call(Writable param, InetSocketAddress addr, Class protocol, User ticket, int rpcTimeout) Excerpt of code where the bug is present: while (!call.done) { if (connection.shouldCloseConnection.get()) { throw new IOException("Unexpected closed connection"); } Throwing this IOException causes the ServerCallable.translateException(t) to be a no-op resulting in HBase retrying. >From my limited view and understanding of the code, one way I could think of handling this is by looking at the closeConnection member variable of a connection to determine what kind of exception should be thrown. Specifically, when a connection is closed, the current code does this: protected synchronized void markClosed(IOException e) { if (shouldCloseConnection.compareAndSet(false, true)) { closeException = e; notifyAll(); } } Within HBaseClient's call method, the code could possibly be modified to: while (!call.done) { if (connection.shouldCloseConnection.get() ) { if(connection.closeException instanceof DoNotRetryIOException) { throw closeException; } throw new IOException("Unexpected closed connection"); } -- This message was sent by Atlassian JIRA (v6.1.4#6159)