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

Steve Loughran updated HADOOP-4475:
-----------------------------------

    Attachment: hadoop-4475.patch

This patch detects null address values early, and fails with a meaningful 
error, rather than an NPE, whenever there is no value for the 
newBindAddressName defined in the configuration. Currently a NPE is triggered 
either in {{NetUtils.getServerAddress()}}, or in the code to create an 
InetAddress which invariably follows it.


It includes tests that verify that
* attempts to retrieve an undefined value fail
* you cannot use the oldBindAddress/oldBindPort values unless the 
newBindAddressName value is set in the configuration
* A non-tuple "hostname" is valid as the newBindAddressName, it is up to 
{{NetUtils.createSocketAddr()}} to do the final parsing and validaton
* invalid triples "host:port:port" get picked up later in 
{{NetUtils.createSocketAddr()}} 
* invalid port numbers "host:twelve" are picked up in 
{{NetUtils.createSocketAddr()}} 
* negative port numbers "host:-23" are picked up in 
{{NetUtils.createSocketAddr()}} 
These are all the existing semantics of the method, now with tests to catch 
regressions. 



> The (deprecated) method NetUtils.getServerAddress() doesn't validate 
> configuration values enough
> ------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-4475
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4475
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.20.0
>            Reporter: Steve Loughran
>            Priority: Minor
>         Attachments: hadoop-4475.patch
>
>
> Although HADOPP-2827 wants to kill this method, it is handy, but it doesn't 
> have enough address validation, and can return a null value, which triggers 
> NPEs a bit later on in the code

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to