MAPREDUCE-6797. Job history server scans can become blocked on a single, slow entry. Contributed by Prabhu Joseph
(cherry picked from commit 99c2bbd337
)
This commit is contained in:
parent
4dc40fe28e
commit
5b1b825ac8
|
@ -227,16 +227,15 @@ public class HistoryFileManager extends AbstractService {
|
|||
JobId firstMoveFailedKey = null;
|
||||
int moveFailedCount = 0;
|
||||
|
||||
while(cache.size() > maxSize && keys.hasNext()) {
|
||||
while (cache.size() > maxSize && keys.hasNext()) {
|
||||
JobId key = keys.next();
|
||||
HistoryFileInfo firstValue = cache.get(key);
|
||||
if(firstValue != null) {
|
||||
synchronized(firstValue) {
|
||||
if (firstValue != null) {
|
||||
if (firstValue.isMovePending()) {
|
||||
if(firstValue.didMoveFail() &&
|
||||
if (firstValue.didMoveFail() &&
|
||||
firstValue.jobIndexInfo.getFinishTime() <= cutoff) {
|
||||
cache.remove(key);
|
||||
//Now lets try to delete it
|
||||
// Now lets try to delete it
|
||||
try {
|
||||
firstValue.delete();
|
||||
} catch (IOException e) {
|
||||
|
@ -261,7 +260,6 @@ public class HistoryFileManager extends AbstractService {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Log output only for first jobhisotry in pendings to restrict
|
||||
// the total number of logs.
|
||||
if (inIntermediateCount > 0) {
|
||||
|
|
Loading…
Reference in New Issue