hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JongYoon Lim (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HAMA-966) NioServerListener doesn't throw any exceptions.
Date Fri, 24 Jul 2015 07:19:04 GMT

     [ https://issues.apache.org/jira/browse/HAMA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

JongYoon Lim updated HAMA-966:
------------------------------
    Fix Version/s: 0.7.1
           Status: Patch Available  (was: Open)

I attached a patch. 
[~udanax], review please..

> 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
>            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)

Mime
View raw message