YARN-5777. TestLogsCLI#testFetchApplictionLogsAsAnotherUser fails. Contributed by Akira Ajisaka.

This commit is contained in:
Xiao Chen 2016-10-25 12:14:27 -07:00
parent 9a8a386458
commit c88c1dc50c

View File

@ -595,6 +595,8 @@ private RemoteIterator<FileStatus> getRemoteNodeFileDir(ApplicationId appId,
} catch (AccessControlException | AccessDeniedException ace) { } catch (AccessControlException | AccessDeniedException ace) {
logDirNoAccessPermission(remoteAppLogDir.toString(), appOwner, logDirNoAccessPermission(remoteAppLogDir.toString(), appOwner,
ace.getMessage()); ace.getMessage());
} catch (IOException ioe) {
logDirIOError(remoteAppLogDir.toString(), ioe.getMessage());
} }
return nodeFiles; return nodeFiles;
} }
@ -644,6 +646,11 @@ private static void logDirNoAccessPermission(String remoteAppLogDir,
+ ". Error message found: " + errorMessage); + ". Error message found: " + errorMessage);
} }
private static void logDirIOError(String remoteAppLogDir, String errMsg) {
System.err.println("Cannot access to " + remoteAppLogDir +
". Error message found: " + errMsg);
}
@Private @Private
public PrintStream createPrintStream(String localDir, String nodeId, public PrintStream createPrintStream(String localDir, String nodeId,
String containerId) throws IOException { String containerId) throws IOException {