MAPREDUCE-5009. Killing the Task Attempt slated for commit does not clear the value from the Task commitAttempt member (Robert Parker via jeagles)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1447969 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
270ecc1b98
commit
e3afdf5aa9
|
@ -574,6 +574,10 @@ Release 0.23.7 - UNRELEASED
|
||||||
MAPREDUCE-4992. AM hangs in RecoveryService when recovering tasks with
|
MAPREDUCE-4992. AM hangs in RecoveryService when recovering tasks with
|
||||||
speculative attempts (Robert Parker via jlowe)
|
speculative attempts (Robert Parker via jlowe)
|
||||||
|
|
||||||
|
MAPREDUCE-5009. Killing the Task Attempt slated for commit does not clear
|
||||||
|
the value from the Task commitAttempt member (Robert Parker via jeagles)
|
||||||
|
|
||||||
|
|
||||||
Release 0.23.6 - UNRELEASED
|
Release 0.23.6 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -857,6 +857,9 @@ public abstract class TaskImpl implements Task, EventHandler<TaskEvent> {
|
||||||
if (task.successfulAttempt == null) {
|
if (task.successfulAttempt == null) {
|
||||||
task.addAndScheduleAttempt(Avataar.VIRGIN);
|
task.addAndScheduleAttempt(Avataar.VIRGIN);
|
||||||
}
|
}
|
||||||
|
if ((task.commitAttempt != null) && (task.commitAttempt == taskAttemptId)) {
|
||||||
|
task.commitAttempt = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,24 @@ public class TestTaskImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testKillDuringTaskAttemptCommit() {
|
||||||
|
mockTask = createMockTask(TaskType.REDUCE);
|
||||||
|
TaskId taskId = getNewTaskID();
|
||||||
|
scheduleTaskAttempt(taskId);
|
||||||
|
|
||||||
|
launchTaskAttempt(getLastAttempt().getAttemptId());
|
||||||
|
updateLastAttemptState(TaskAttemptState.COMMIT_PENDING);
|
||||||
|
commitTaskAttempt(getLastAttempt().getAttemptId());
|
||||||
|
|
||||||
|
TaskAttemptId commitAttempt = getLastAttempt().getAttemptId();
|
||||||
|
updateLastAttemptState(TaskAttemptState.KILLED);
|
||||||
|
killRunningTaskAttempt(commitAttempt);
|
||||||
|
|
||||||
|
assertFalse(mockTask.canCommit(commitAttempt));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFailureDuringTaskAttemptCommit() {
|
public void testFailureDuringTaskAttemptCommit() {
|
||||||
mockTask = createMockTask(TaskType.MAP);
|
mockTask = createMockTask(TaskType.MAP);
|
||||||
|
|
Loading…
Reference in New Issue