|
@@ -1372,6 +1372,19 @@ public abstract class TaskAttemptImpl implements
|
|
return tauce;
|
|
return tauce;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static void
|
|
|
|
+ sendJHStartEventForAssignedFailTask(TaskAttemptImpl taskAttempt) {
|
|
|
|
+ TaskAttemptContainerLaunchedEvent event;
|
|
|
|
+ taskAttempt.launchTime = taskAttempt.clock.getTime();
|
|
|
|
+
|
|
|
|
+ InetSocketAddress nodeHttpInetAddr =
|
|
|
|
+ NetUtils.createSocketAddr(taskAttempt.container.getNodeHttpAddress());
|
|
|
|
+ taskAttempt.trackerName = nodeHttpInetAddr.getHostName();
|
|
|
|
+ taskAttempt.httpPort = nodeHttpInetAddr.getPort();
|
|
|
|
+ taskAttempt.sendLaunchedEvents();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
private void sendLaunchedEvents() {
|
|
private void sendLaunchedEvents() {
|
|
JobCounterUpdateEvent jce = new JobCounterUpdateEvent(attemptId.getTaskId()
|
|
JobCounterUpdateEvent jce = new JobCounterUpdateEvent(attemptId.getTaskId()
|
|
@@ -1560,6 +1573,9 @@ public abstract class TaskAttemptImpl implements
|
|
@Override
|
|
@Override
|
|
public void transition(TaskAttemptImpl taskAttempt,
|
|
public void transition(TaskAttemptImpl taskAttempt,
|
|
TaskAttemptEvent event) {
|
|
TaskAttemptEvent event) {
|
|
|
|
+ if (taskAttempt.getLaunchTime() == 0) {
|
|
|
|
+ sendJHStartEventForAssignedFailTask(taskAttempt);
|
|
|
|
+ }
|
|
//set the finish time
|
|
//set the finish time
|
|
taskAttempt.setFinishTime();
|
|
taskAttempt.setFinishTime();
|
|
|
|
|
|
@@ -1594,23 +1610,19 @@ public abstract class TaskAttemptImpl implements
|
|
default:
|
|
default:
|
|
LOG.error("Task final state is not FAILED or KILLED: " + finalState);
|
|
LOG.error("Task final state is not FAILED or KILLED: " + finalState);
|
|
}
|
|
}
|
|
- if (taskAttempt.getLaunchTime() != 0) {
|
|
|
|
- TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
- createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
- finalState);
|
|
|
|
- if(finalState == TaskAttemptStateInternal.FAILED) {
|
|
|
|
- taskAttempt.eventHandler
|
|
|
|
- .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
|
|
|
|
- } else if(finalState == TaskAttemptStateInternal.KILLED) {
|
|
|
|
- taskAttempt.eventHandler
|
|
|
|
- .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
|
|
|
|
- }
|
|
|
|
- taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
- taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
|
|
- } else {
|
|
|
|
- LOG.debug("Not generating HistoryFinish event since start event not " +
|
|
|
|
- "generated for taskAttempt: " + taskAttempt.getID());
|
|
|
|
|
|
+
|
|
|
|
+ TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
+ createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
+ finalState);
|
|
|
|
+ if(finalState == TaskAttemptStateInternal.FAILED) {
|
|
|
|
+ taskAttempt.eventHandler
|
|
|
|
+ .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
|
|
|
|
+ } else if(finalState == TaskAttemptStateInternal.KILLED) {
|
|
|
|
+ taskAttempt.eventHandler
|
|
|
|
+ .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
|
|
}
|
|
}
|
|
|
|
+ taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
+ taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1702,23 +1714,20 @@ public abstract class TaskAttemptImpl implements
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
@Override
|
|
@Override
|
|
public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) {
|
|
public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) {
|
|
|
|
+ if (taskAttempt.getLaunchTime() == 0) {
|
|
|
|
+ sendJHStartEventForAssignedFailTask(taskAttempt);
|
|
|
|
+ }
|
|
// set the finish time
|
|
// set the finish time
|
|
taskAttempt.setFinishTime();
|
|
taskAttempt.setFinishTime();
|
|
|
|
+
|
|
|
|
+ taskAttempt.eventHandler
|
|
|
|
+ .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
|
|
|
|
+ TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
+ createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
+ TaskAttemptStateInternal.FAILED);
|
|
|
|
+ taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
+ taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
|
|
|
|
- if (taskAttempt.getLaunchTime() != 0) {
|
|
|
|
- taskAttempt.eventHandler
|
|
|
|
- .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
|
|
|
|
- TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
- createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
- TaskAttemptStateInternal.FAILED);
|
|
|
|
- taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
- taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
|
|
- // taskAttempt.logAttemptFinishedEvent(TaskAttemptStateInternal.FAILED); Not
|
|
|
|
- // handling failed map/reduce events.
|
|
|
|
- }else {
|
|
|
|
- LOG.debug("Not generating HistoryFinish event since start event not " +
|
|
|
|
- "generated for taskAttempt: " + taskAttempt.getID());
|
|
|
|
- }
|
|
|
|
taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
|
|
taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
|
|
taskAttempt.attemptId, TaskEventType.T_ATTEMPT_FAILED));
|
|
taskAttempt.attemptId, TaskEventType.T_ATTEMPT_FAILED));
|
|
}
|
|
}
|
|
@@ -1855,27 +1864,25 @@ public abstract class TaskAttemptImpl implements
|
|
@Override
|
|
@Override
|
|
public void transition(TaskAttemptImpl taskAttempt,
|
|
public void transition(TaskAttemptImpl taskAttempt,
|
|
TaskAttemptEvent event) {
|
|
TaskAttemptEvent event) {
|
|
|
|
+ if (taskAttempt.getLaunchTime() == 0) {
|
|
|
|
+ sendJHStartEventForAssignedFailTask(taskAttempt);
|
|
|
|
+ }
|
|
//set the finish time
|
|
//set the finish time
|
|
taskAttempt.setFinishTime();
|
|
taskAttempt.setFinishTime();
|
|
- if (taskAttempt.getLaunchTime() != 0) {
|
|
|
|
- taskAttempt.eventHandler
|
|
|
|
- .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
|
|
|
|
- TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
- createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
- TaskAttemptStateInternal.KILLED);
|
|
|
|
- taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
- taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
|
|
- }else {
|
|
|
|
- LOG.debug("Not generating HistoryFinish event since start event not " +
|
|
|
|
- "generated for taskAttempt: " + taskAttempt.getID());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ taskAttempt.eventHandler
|
|
|
|
+ .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
|
|
|
|
+ TaskAttemptUnsuccessfulCompletionEvent tauce =
|
|
|
|
+ createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
|
|
|
|
+ TaskAttemptStateInternal.KILLED);
|
|
|
|
+ taskAttempt.eventHandler.handle(new JobHistoryEvent(
|
|
|
|
+ taskAttempt.attemptId.getTaskId().getJobId(), tauce));
|
|
|
|
|
|
if (event instanceof TaskAttemptKillEvent) {
|
|
if (event instanceof TaskAttemptKillEvent) {
|
|
taskAttempt.addDiagnosticInfo(
|
|
taskAttempt.addDiagnosticInfo(
|
|
((TaskAttemptKillEvent) event).getMessage());
|
|
((TaskAttemptKillEvent) event).getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
-// taskAttempt.logAttemptFinishedEvent(TaskAttemptStateInternal.KILLED); Not logging Map/Reduce attempts in case of failure.
|
|
|
|
taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
|
|
taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
|
|
taskAttempt.attemptId,
|
|
taskAttempt.attemptId,
|
|
TaskEventType.T_ATTEMPT_KILLED));
|
|
TaskEventType.T_ATTEMPT_KILLED));
|