You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "Edward J. Yoon (JIRA)" <ji...@apache.org> on 2015/07/24 06:18:04 UTC

[jira] [Commented] (HAMA-966) NioServerListener doesn't throw any exceptions.

    [ https://issues.apache.org/jira/browse/HAMA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14639891#comment-14639891 ] 

Edward J. Yoon commented on HAMA-966:
-------------------------------------

Hi,

Here's some background for you. Basically, each BSP task starts RPC server for communication among other tasks. If 'bsp.tasks.maximum' is 3, then GroomServer of Hama framework launches maximum 3 tasks per node. By default, they uses assigned port numbers 61000, 61001, and 61002 from GroomServer. When startServer() method is called, we checks whether assigned port is available or not once more. Because, there are occasionally binding problems with abnormally crashed zombie tasks from previous job.

As you mentioned, it should be considered an RPC server start failure and an exception should be thrown. I love Option 2. Question is that only BindException can be occurred.

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