Skip to content

Commit a56ea01

Browse files
committed
YARN-2377. Localization exception stack traces are not passed as diagnostic info. Contributed by Gera Shegalov
1 parent 1770bb9 commit a56ea01

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

hadoop-yarn-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ Release 2.6.0 - UNRELEASED
633633
YARN-2651. Spun off LogRollingInterval from LogAggregationContext. (Xuan Gong
634634
via zjshen)
635635

636+
YARN-2377. Localization exception stack traces are not passed as
637+
diagnostic info (Gera Shegalov via jlowe)
638+
636639
Release 2.5.1 - 2014-09-05
637640

638641
INCOMPATIBLE CHANGES

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/SerializedException.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,22 @@ public static SerializedException newInstance(Throwable e) {
9090
@Private
9191
@Unstable
9292
public abstract Throwable deSerialize();
93+
94+
private void stringify(StringBuilder sb) {
95+
sb.append(getMessage())
96+
.append("\n")
97+
.append(getRemoteTrace());
98+
final SerializedException cause = getCause();
99+
if (cause != null) {
100+
sb.append("Caused by: ");
101+
cause.stringify(sb);
102+
}
103+
}
104+
105+
@Override
106+
public String toString() {
107+
final StringBuilder sb = new StringBuilder(128);
108+
stringify(sb);
109+
return sb.toString();
110+
}
93111
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,12 +1008,12 @@ LocalizerHeartbeatResponse update(
10081008
response.setLocalizerAction(LocalizerAction.LIVE);
10091009
break;
10101010
case FETCH_FAILURE:
1011-
LOG.info("DEBUG: FAILED " + req
1012-
+ ", " + stat.getException().getMessage());
1011+
final String diagnostics = stat.getException().toString();
1012+
LOG.warn(req + " failed: " + diagnostics);
10131013
response.setLocalizerAction(LocalizerAction.DIE);
10141014
getLocalResourcesTracker(req.getVisibility(), user, applicationId)
10151015
.handle(new ResourceFailedLocalizationEvent(
1016-
req, stat.getException().getMessage()));
1016+
req, diagnostics));
10171017

10181018
// unlocking the resource and removing it from scheduled resource
10191019
// list

0 commit comments

Comments
 (0)