hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Doe (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MAPREDUCE-7088) DistributedFSCheckMapper.doIO hangs with user misconfigured inputs
Date Fri, 27 Apr 2018 17:42:00 GMT

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

John Doe updated MAPREDUCE-7088:
--------------------------------
    Component/s: client

> DistributedFSCheckMapper.doIO hangs with user misconfigured inputs
> ------------------------------------------------------------------
>
>                 Key: MAPREDUCE-7088
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7088
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: client, test
>    Affects Versions: 2.5.0
>            Reporter: John Doe
>            Priority: Minor
>
> When a user configures the bufferSize to be 0, the for loop in DistributedFSCheck$DistributedFSCheckMapper.doIO
function hangs endlessly. Here is the code snippet.
> {code:java}
>     int bufferSize = DEFAULT_BUFFER_SIZE;
>     for(int i = 0; i < args.length; i++) { // parse command line
>      ...
>      else if (args[i].equals("-bufferSize")) {
>         bufferSize = Integer.parseInt(args[++i]);
>       }
>      ...
>     }
>     public Object doIO(Reporter reporter, String name,  long offset) throws IOException
{
>       // open file
>       FSDataInputStream in = null;
>       Path p = new Path(name);
>       try {
>         in = fs.open(p);
>       } catch(IOException e) {
>         return name + "@(missing)";
>       }
>       in.seek(offset);
>       long actualSize = 0;
>       try {
>         long blockSize = fs.getDefaultBlockSize(p);
>         reporter.setStatus("reading " + name + "@" + offset + "/" + blockSize);
>         for( int curSize = bufferSize; 
>              curSize == bufferSize && actualSize < blockSize;
>              actualSize += curSize) {
>           curSize = in.read(buffer, 0, bufferSize);
>         }
>       } catch(IOException e) {
>         ...
>       } finally {
>         in.close();
>       }
>       return new Long(actualSize);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org


Mime
View raw message