Merge 1550570 from trunk to branch-2 for HADOOP-8753. LocalDirAllocator throws ArithmeticException: divide by zero when there is no available space on configured local dir. Contributed by Benoy Antony.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1550571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3033fad821
commit
35bf9069ce
|
@ -178,6 +178,9 @@ Release 2.4.0 - UNRELEASED
|
|||
TestFileContextResolveAfs and TestStat in branch-2 (Mit Desai via Colin
|
||||
Patrick McCabe)
|
||||
|
||||
HADOOP-8753. LocalDirAllocator throws "ArithmeticException: / by zero" when
|
||||
there is no available space on configured local dir. (Benoy Antony via hitesh)
|
||||
|
||||
Release 2.3.0 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -362,6 +362,10 @@ public class LocalDirAllocator {
|
|||
totalAvailable += availableOnDisk[i];
|
||||
}
|
||||
|
||||
if (totalAvailable == 0){
|
||||
throw new DiskErrorException("No space available in any of the local directories.");
|
||||
}
|
||||
|
||||
// Keep rolling the wheel till we get a valid path
|
||||
Random r = new java.util.Random();
|
||||
while (numDirsSearched < numDirs && returnPath == null) {
|
||||
|
|
Loading…
Reference in New Issue