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

Eli Collins commented on HADOOP-9079:
-------------------------------------

I assume this happens when the local dirs are out of space?  Don't think just 
checking totalAvailable > 0 fixes this, the following loop doesn't bounds check 
dir, needs to be re-written with a test.

{code}
          long randomPosition = Math.abs(r.nextLong()) % totalAvailable;
          int dir = 0;
          while (randomPosition > availableOnDisk[dir]) {
            randomPosition -= availableOnDisk[dir];
            dir++;
          }
{code}
                
> LocalDirAllocator throws ArithmeticException
> --------------------------------------------
>
>                 Key: HADOOP-9079
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9079
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Jimmy Xiang
>            Priority: Minor
>         Attachments: trunk-9079.patch
>
>
> 2012-11-19 22:07:41,709 WARN  [IPC Server handler 0 on 38671] 
> nodemanager.NMAuditLogger(150): USER=UnknownUser        IP=**** 
> OPERATION=Stop Container Request        TARGET=ContainerManagerImpl     
> RESULT=FAILURE  DESCRIPTION=Trying to stop unknown container!   
> APPID=application_1353391620476_0001    
> CONTAINERID=container_1353391620476_0001_01_000010
> java.lang.ArithmeticException: / by zero
>       at 
> org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:368)
>       at 
> org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:150)
>       at 
> org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:131)
>       at 
> org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:115)
>       at 
> org.apache.hadoop.yarn.server.nodemanager.LocalDirsHandlerService.getLocalPathForWrite(LocalDirsHandlerService.java:263)
>       at 
> org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService$LocalizerRunner.run(ResourceLocalizationService.java:849)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to