You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by dd...@apache.org on 2009/03/30 14:00:46 UTC
svn commit: r759932 - in /hadoop/core/trunk: CHANGES.txt
src/mapred/org/apache/hadoop/mapred/JobInProgress.java
src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
Author: ddas
Date: Mon Mar 30 12:00:45 2009
New Revision: 759932
URL: http://svn.apache.org/viewvc?rev=759932&view=rev
Log:
HADOOP-5473. Solves a race condition in killing a task - the state is KILLED if there is a user request pending to kill the task and the TT reported the state as SUCCESS. Contributed by Amareshwari Sriramadasu.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=759932&r1=759931&r2=759932&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Mar 30 12:00:45 2009
@@ -1139,6 +1139,10 @@
HADOOP-5588. Remove an unnecessary call to listStatus(..) in
FileSystem.globStatusInternal(..). (Hairong Kuang via szetszwo)
+ HADOOP-5473. Solves a race condition in killing a task - the state is KILLED
+ if there is a user request pending to kill the task and the TT reported
+ the state as SUCCESS. (Amareshwari Sriramadasu via ddas)
+
Release 0.19.2 - Unreleased
BUG FIXES
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=759932&r1=759931&r2=759932&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobInProgress.java Mon Mar 30 12:00:45 2009
@@ -748,7 +748,10 @@
// mark the task as KILLED.
// In case of task with no promotion the task tracker will mark the task
// as SUCCEEDED.
- if (wasComplete && (status.getRunState() == TaskStatus.State.SUCCEEDED)) {
+ // User has requested to kill the task, but TT reported SUCCEEDED,
+ // mark the task KILLED.
+ if ((wasComplete || tip.wasKilled(taskid)) &&
+ (status.getRunState() == TaskStatus.State.SUCCEEDED)) {
status.setRunState(TaskStatus.State.KILLED);
}
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java?rev=759932&r1=759931&r2=759932&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java Mon Mar 30 12:00:45 2009
@@ -590,7 +590,8 @@
// Check if the user manually KILLED/FAILED this task-attempt...
Boolean shouldFail = tasksToKill.remove(taskid);
if (shouldFail != null) {
- if (isCleanupAttempt(taskid) || jobSetup || jobCleanup) {
+ if (status.getRunState() == TaskStatus.State.FAILED ||
+ status.getRunState() == TaskStatus.State.KILLED) {
taskState = (shouldFail) ? TaskStatus.State.FAILED :
TaskStatus.State.KILLED;
} else {
@@ -969,6 +970,10 @@
return taskStatuses.get(taskid).getTaskTracker();
}
+ boolean wasKilled(TaskAttemptID taskid) {
+ return tasksToKill.containsKey(taskid);
+ }
+
/**
* Has this task already failed on this machine?
* @param trackerHost The task tracker hostname