diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 99eea88703..06c755488f 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -723,6 +723,10 @@ Release 0.23.7 - UNRELEASED MAPREDUCE-4992. AM hangs in RecoveryService when recovering tasks with 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 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java index c45197e157..f0e120421b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java @@ -857,6 +857,9 @@ public void transition(TaskImpl task, TaskEvent event) { if (task.successfulAttempt == null) { task.addAndScheduleAttempt(Avataar.VIRGIN); } + if ((task.commitAttempt != null) && (task.commitAttempt == taskAttemptId)) { + task.commitAttempt = null; + } } } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskImpl.java index 3f03dc3fd3..d3297b3fb6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskImpl.java @@ -491,7 +491,25 @@ public void testTaskProgress() { assert(mockTask.getProgress() == progress); } + + @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 public void testFailureDuringTaskAttemptCommit() { mockTask = createMockTask(TaskType.MAP);