|
@@ -134,6 +134,9 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
|
|
|
|
private Configuration conf;
|
|
private Configuration conf;
|
|
|
|
|
|
|
|
+ private static final ExpiredTransition EXPIRED_TRANSITION =
|
|
|
|
+ new ExpiredTransition();
|
|
|
|
+
|
|
private static final StateMachineFactory<RMAppAttemptImpl,
|
|
private static final StateMachineFactory<RMAppAttemptImpl,
|
|
RMAppAttemptState,
|
|
RMAppAttemptState,
|
|
RMAppAttemptEventType,
|
|
RMAppAttemptEventType,
|
|
@@ -189,7 +192,7 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
.addTransition(
|
|
.addTransition(
|
|
RMAppAttemptState.LAUNCHED, RMAppAttemptState.FAILED,
|
|
RMAppAttemptState.LAUNCHED, RMAppAttemptState.FAILED,
|
|
RMAppAttemptEventType.EXPIRE,
|
|
RMAppAttemptEventType.EXPIRE,
|
|
- new FinalTransition(RMAppAttemptState.FAILED))
|
|
|
|
|
|
+ EXPIRED_TRANSITION)
|
|
.addTransition(RMAppAttemptState.LAUNCHED, RMAppAttemptState.KILLED,
|
|
.addTransition(RMAppAttemptState.LAUNCHED, RMAppAttemptState.KILLED,
|
|
RMAppAttemptEventType.KILL,
|
|
RMAppAttemptEventType.KILL,
|
|
new FinalTransition(RMAppAttemptState.KILLED))
|
|
new FinalTransition(RMAppAttemptState.KILLED))
|
|
@@ -213,7 +216,7 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
.addTransition(
|
|
.addTransition(
|
|
RMAppAttemptState.RUNNING, RMAppAttemptState.FAILED,
|
|
RMAppAttemptState.RUNNING, RMAppAttemptState.FAILED,
|
|
RMAppAttemptEventType.EXPIRE,
|
|
RMAppAttemptEventType.EXPIRE,
|
|
- new FinalTransition(RMAppAttemptState.FAILED))
|
|
|
|
|
|
+ EXPIRED_TRANSITION)
|
|
.addTransition(
|
|
.addTransition(
|
|
RMAppAttemptState.RUNNING, RMAppAttemptState.KILLED,
|
|
RMAppAttemptState.RUNNING, RMAppAttemptState.KILLED,
|
|
RMAppAttemptEventType.KILL,
|
|
RMAppAttemptEventType.KILL,
|
|
@@ -391,6 +394,13 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void setTrackingUrlToRMAppPage() {
|
|
|
|
+ origTrackingUrl = pjoin(
|
|
|
|
+ YarnConfiguration.getRMWebAppHostAndPort(conf),
|
|
|
|
+ "cluster", "app", getAppAttemptId().getApplicationId());
|
|
|
|
+ proxiedTrackingUrl = origTrackingUrl;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public String getClientToken() {
|
|
public String getClientToken() {
|
|
return this.clientToken;
|
|
return this.clientToken;
|
|
@@ -828,6 +838,22 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static class ExpiredTransition extends FinalTransition {
|
|
|
|
+
|
|
|
|
+ public ExpiredTransition() {
|
|
|
|
+ super(RMAppAttemptState.FAILED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void transition(RMAppAttemptImpl appAttempt,
|
|
|
|
+ RMAppAttemptEvent event) {
|
|
|
|
+ appAttempt.diagnostics.append("ApplicationMaster for attempt " +
|
|
|
|
+ appAttempt.getAppAttemptId() + " timed out");
|
|
|
|
+ appAttempt.setTrackingUrlToRMAppPage();
|
|
|
|
+ super.transition(appAttempt, event);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private static final class StatusUpdateTransition extends
|
|
private static final class StatusUpdateTransition extends
|
|
BaseTransition {
|
|
BaseTransition {
|
|
@Override
|
|
@Override
|
|
@@ -907,10 +933,7 @@ public class RMAppAttemptImpl implements RMAppAttempt {
|
|
// When the AM dies, the trackingUrl is left pointing to the AM's URL,
|
|
// When the AM dies, the trackingUrl is left pointing to the AM's URL,
|
|
// which shows up in the scheduler UI as a broken link. Direct the
|
|
// which shows up in the scheduler UI as a broken link. Direct the
|
|
// user to the app page on the RM so they can see the status and logs.
|
|
// user to the app page on the RM so they can see the status and logs.
|
|
- appAttempt.origTrackingUrl = pjoin(
|
|
|
|
- YarnConfiguration.getRMWebAppHostAndPort(appAttempt.conf),
|
|
|
|
- "cluster", "app", appAttempt.getAppAttemptId().getApplicationId());
|
|
|
|
- appAttempt.proxiedTrackingUrl = appAttempt.origTrackingUrl;
|
|
|
|
|
|
+ appAttempt.setTrackingUrlToRMAppPage();
|
|
|
|
|
|
new FinalTransition(RMAppAttemptState.FAILED).transition(
|
|
new FinalTransition(RMAppAttemptState.FAILED).transition(
|
|
appAttempt, containerFinishedEvent);
|
|
appAttempt, containerFinishedEvent);
|