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

Jeffrey Naisbitt commented on MAPREDUCE-2489:
---------------------------------------------

Mahadev,
There are two parts to this patch.  The most important is the use of the new 
"resolveValidHosts" function and throwing the UnknownHostException up the 
chain.  That part ensures that the hostnames are actually valid and is needed 
to resolve the problem this Jira was filed for. 

The second part (that you describe above) is meant to only be an early sanity 
check.  All it is trying to do is ensure that the hostnames "appear" to be 
valid.  With this, I'm just trying to check the hostname string itself to see 
that it contains valid characters and such so we can fail early on if the 
hostname string contains garbage (like in the original case this Jira was filed 
for).  The URI object seemed the easiest and most standard way I could find to 
do this.  The URI object creation will fail, or the uri.getHost() method will 
return null if the string passed in doesn't match their regular expressions for 
what a URI should look like (which includes checking the hostname portion).  
The URI object requires a schema (http://, ftp://, etc.), so I add one on if it 
doesn't already have one in the string.  Again, this is only really meant to 
catch the garbage string cases, and it's not meant to be a perfect check that 
will catch all hostname problems (those are caught by the first part of the 
patch mentioned above).

Does that make sense?  If you have other questions or suggestions, please let 
me know :) 
Thanks for looking at it!

> Jobsplits with random hostnames can make the queue unusable
> -----------------------------------------------------------
>
>                 Key: MAPREDUCE-2489
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2489
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: jobtracker
>    Affects Versions: 0.20.205.0, 0.23.0
>            Reporter: Jeffrey Naisbitt
>            Assignee: Jeffrey Naisbitt
>             Fix For: 0.20.205.0, 0.23.0
>
>         Attachments: MAPREDUCE-2489-0.20s-v2.patch, 
> MAPREDUCE-2489-0.20s-v3.patch, MAPREDUCE-2489-0.20s.patch, 
> MAPREDUCE-2489-mapred-v2.patch, MAPREDUCE-2489-mapred-v3.patch, 
> MAPREDUCE-2489-mapred-v4.patch, MAPREDUCE-2489-mapred.patch
>
>
> We saw an issue where a custom InputSplit was returning invalid hostnames for 
> the splits that were then causing the JobTracker to attempt to excessively 
> resolve host names.  This caused a major slowdown for the JobTracker.  We 
> should prevent invalid InputSplit hostnames from affecting everyone else.
> I propose we implement some verification for the hostnames to try to ensure 
> that we only do DNS lookups on valid hostnames (and fail otherwise).  We 
> could also fail the job after a certain number of failures in the resolve.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to