Return-Path: X-Original-To: apmail-tajo-issues-archive@minotaur.apache.org Delivered-To: apmail-tajo-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C585A17DAB for ; Mon, 20 Jul 2015 00:32:14 +0000 (UTC) Received: (qmail 41653 invoked by uid 500); 20 Jul 2015 00:32:14 -0000 Delivered-To: apmail-tajo-issues-archive@tajo.apache.org Received: (qmail 41609 invoked by uid 500); 20 Jul 2015 00:32:14 -0000 Mailing-List: contact issues-help@tajo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.apache.org Delivered-To: mailing list issues@tajo.apache.org Received: (qmail 41600 invoked by uid 99); 20 Jul 2015 00:32:14 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2015 00:32:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3A45E188DF2 for ; Mon, 20 Jul 2015 00:32:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.991 X-Spam-Level: X-Spam-Status: No, score=0.991 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Mqt1T9rGn0oI for ; Mon, 20 Jul 2015 00:32:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id A0E7121767 for ; Mon, 20 Jul 2015 00:32:05 +0000 (UTC) Received: (qmail 41582 invoked by uid 99); 20 Jul 2015 00:32:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2015 00:32:04 +0000 Date: Mon, 20 Jul 2015 00:32:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@tajo.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TAJO-1670) Refactor client errors and exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632996#comment-14632996 ] ASF GitHub Bot commented on TAJO-1670: -------------------------------------- Github user jihoonson commented on a diff in the pull request: https://github.com/apache/tajo/pull/621#discussion_r34964536 --- Diff: tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java --- @@ -98,33 +106,49 @@ public SessionConnection(@NotNull ServiceTracker tracker, @Nullable String baseD this.manager.setRetries(properties.getInt(RpcConstants.RPC_CLIENT_RETRY_MAX, RpcConstants.DEFAULT_RPC_RETRIES)); this.userInfo = UserRoleInfo.getCurrentUser(); - try { - this.client = getTajoMasterConnection(); - } catch (ServiceException e) { - throw new IOException(e); - } + this.client = getTajoMasterConnection(); } public Map getClientSideSessionVars() { return Collections.unmodifiableMap(sessionVarsCache); } - public synchronized NettyClientBase getTajoMasterConnection() throws ServiceException { - if (client != null && client.isConnected()) return client; - else { + public synchronized NettyClientBase getTajoMasterConnection() throws SQLException { + + if (client != null && client.isConnected()) { + return client; + } else { + try { RpcClientManager.cleanup(client); + // Client do not closed on idle state for support high available - this.client = manager.newClient(getTajoMasterAddr(), TajoMasterClientProtocol.class, false, - manager.getRetries(), 0, TimeUnit.SECONDS, false); + this.client = manager.newClient( + getTajoMasterAddr(), + TajoMasterClientProtocol.class, + false, + manager.getRetries(), + 0, + TimeUnit.SECONDS, + false); connections.incrementAndGet(); - } catch (Exception e) { - throw new ServiceException(e); + + } catch (Throwable t) { + throw SQLExceptionUtil.makeUnableToEstablishConnection(t); } + return client; } } + protected BlockingInterface getTMStub() throws SQLException { --- End diff -- Ok. If so, please add a brief comment. > Refactor client errors and exceptions > ------------------------------------- > > Key: TAJO-1670 > URL: https://issues.apache.org/jira/browse/TAJO-1670 > Project: Tajo > Issue Type: Sub-task > Components: Java Client, TajoMaster, Worker > Reporter: Hyunsik Choi > Assignee: Hyunsik Choi > Fix For: 0.11.0 > > > The main objective is to refactor the error and exception system in client side and its connected parts like TajoMaster. -- This message was sent by Atlassian JIRA (v6.3.4#6332)