Return-Path: X-Original-To: apmail-hama-dev-archive@www.apache.org Delivered-To: apmail-hama-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 474ED18AFF for ; Fri, 24 Jul 2015 23:48:05 +0000 (UTC) Received: (qmail 65654 invoked by uid 500); 24 Jul 2015 23:48:05 -0000 Delivered-To: apmail-hama-dev-archive@hama.apache.org Received: (qmail 65620 invoked by uid 500); 24 Jul 2015 23:48:05 -0000 Mailing-List: contact dev-help@hama.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hama.apache.org Delivered-To: mailing list dev@hama.apache.org Received: (qmail 65606 invoked by uid 99); 24 Jul 2015 23:48:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2015 23:48:05 +0000 Date: Fri, 24 Jul 2015 23:48:04 +0000 (UTC) From: "Hudson (JIRA)" To: dev@hama.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HAMA-966) NioServerListener doesn't throw any 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/HAMA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14641256#comment-14641256 ] Hudson commented on HAMA-966: ----------------------------- SUCCESS: Integrated in Hama-Nightly-for-Hadoop-2.x #677 (See [https://builds.apache.org/job/Hama-Nightly-for-Hadoop-2.x/677/]) HAMA-966: NioServerListener doesn't throw any exceptions (JongYoon Lim via edwardyoon) (edwardyoon: rev 1692461) * /hama/trunk/CHANGES.txt * /hama/trunk/core/src/main/java/org/apache/hama/bsp/message/HamaAsyncMessageManagerImpl.java * /hama/trunk/core/src/main/java/org/apache/hama/ipc/AsyncServer.java > NioServerListener doesn't throw any exceptions. > ----------------------------------------------- > > Key: HAMA-966 > URL: https://issues.apache.org/jira/browse/HAMA-966 > Project: Hama > Issue Type: Bug > Components: bsp core > Affects Versions: 0.7.0 > Reporter: JongYoon Lim > Assignee: JongYoon Lim > Priority: Minor > Fix For: 0.7.1 > > Attachments: HAMA-966.patch > > > *NioServerListener* which extends *Thread* can't throw any exceptions because it swallows them in *run()* as follows. > {code:java} > try { > // code for server bootstraping and binding > } catch (Exception e) { > e.printStackTrace(); > } > {code} > This results in that *startServer()* can't catch *BindException* and retry to start the server recursively. There can be two options. > * Option 1. Use *Thread.UncaughtExceptionHandler*. > * Option 2. Make *NioServerListener* extend *Callable* and use *get()* of *Future* to catch exceptions. > I think *Option 2* looks better because the code could be more intuitive. -- This message was sent by Atlassian JIRA (v6.3.4#6332)