YARN-8403. Change the log level for fail to download resource from INFO to ERROR. Contributed by Eric Yang

This commit is contained in:
Billie Rinaldi 2018-08-01 08:51:18 -07:00
parent d920b9db77
commit 67c65da261
2 changed files with 14 additions and 5 deletions

View File

@ -969,11 +969,17 @@ public void run() {
.getDU(new File(local.toUri()))));
assoc.getResource().unlock();
} catch (ExecutionException e) {
LOG.info("Failed to download resource " + assoc.getResource(),
e.getCause());
LocalResourceRequest req = assoc.getResource().getRequest();
publicRsrc.handle(new ResourceFailedLocalizationEvent(req,
e.getMessage()));
String user = assoc.getContext().getUser();
ApplicationId applicationId = assoc.getContext().getContainerId().getApplicationAttemptId().getApplicationId();
LocalResourcesTracker tracker =
getLocalResourcesTracker(LocalResourceVisibility.APPLICATION, user, applicationId);
final String diagnostics = "Failed to download resource " +
assoc.getResource() + " " + e.getCause();
tracker.handle(new ResourceFailedLocalizationEvent(
assoc.getResource().getRequest(), diagnostics));
publicRsrc.handle(new ResourceFailedLocalizationEvent(
assoc.getResource().getRequest(), diagnostics));
LOG.error(diagnostics);
assoc.getResource().unlock();
} catch (CancellationException e) {
// ignore; shutting down

View File

@ -2398,6 +2398,9 @@ public void testParallelDownloadAttemptsForPublicResource() throws Exception {
// Waiting for resource to change into FAILED state.
Assert.assertTrue(waitForResourceState(lr, spyService, req,
LocalResourceVisibility.PUBLIC, user, null, ResourceState.FAILED, 5000));
Assert.assertTrue(waitForResourceState(lr, spyService, req,
LocalResourceVisibility.APPLICATION, user, appId, ResourceState.FAILED, 5000));
// releasing lock as a part of download failed process.
lr.unlock();
// removing pending download request.