YARN-2377. Localization exception stack traces are not passed as diagnostic info. Contributed by Gera Shegalov

(cherry picked from commit a56ea01002)
This commit is contained in:
Jason Lowe 2014-10-13 18:31:16 +00:00
parent 6da637ec12
commit 9d73c1b15f
3 changed files with 24 additions and 3 deletions

View File

@ -570,6 +570,9 @@ Release 2.6.0 - UNRELEASED
YARN-2651. Spun off LogRollingInterval from LogAggregationContext. (Xuan Gong YARN-2651. Spun off LogRollingInterval from LogAggregationContext. (Xuan Gong
via zjshen) via zjshen)
YARN-2377. Localization exception stack traces are not passed as
diagnostic info (Gera Shegalov via jlowe)
Release 2.5.1 - 2014-09-05 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -90,4 +90,22 @@ public abstract class SerializedException {
@Private @Private
@Unstable @Unstable
public abstract Throwable deSerialize(); public abstract Throwable deSerialize();
private void stringify(StringBuilder sb) {
sb.append(getMessage())
.append("\n")
.append(getRemoteTrace());
final SerializedException cause = getCause();
if (cause != null) {
sb.append("Caused by: ");
cause.stringify(sb);
}
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder(128);
stringify(sb);
return sb.toString();
}
} }

View File

@ -1008,12 +1008,12 @@ public class ResourceLocalizationService extends CompositeService
response.setLocalizerAction(LocalizerAction.LIVE); response.setLocalizerAction(LocalizerAction.LIVE);
break; break;
case FETCH_FAILURE: case FETCH_FAILURE:
LOG.info("DEBUG: FAILED " + req final String diagnostics = stat.getException().toString();
+ ", " + stat.getException().getMessage()); LOG.warn(req + " failed: " + diagnostics);
response.setLocalizerAction(LocalizerAction.DIE); response.setLocalizerAction(LocalizerAction.DIE);
getLocalResourcesTracker(req.getVisibility(), user, applicationId) getLocalResourcesTracker(req.getVisibility(), user, applicationId)
.handle(new ResourceFailedLocalizationEvent( .handle(new ResourceFailedLocalizationEvent(
req, stat.getException().getMessage())); req, diagnostics));
// unlocking the resource and removing it from scheduled resource // unlocking the resource and removing it from scheduled resource
// list // list