[ 
https://issues.apache.org/jira/browse/YARN-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635546#comment-14635546
 ] 

Jason Lowe commented on YARN-3925:
----------------------------------

Nice catch, [~zxu]!

I think the patch will work, but it is a bit convoluted to use a new dir 
allocator and a new config property as a roundabout way to call 
LocalDirAllocator.AllocatorPerContext.getLocalPathToRead which is not a very 
complicated function.  LocalDirsHandlerService already has the list of Paths to 
check, so if we just refactored the getLocalPathToRead functionality into a 
reusable Path utility function to locate a subpath given a list of top-level 
paths to search it would be very straightforward.

> ContainerLogsUtils#getContainerLogFile fails to read container log files from 
> full disks.
> -----------------------------------------------------------------------------------------
>
>                 Key: YARN-3925
>                 URL: https://issues.apache.org/jira/browse/YARN-3925
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>    Affects Versions: 2.7.1
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>            Priority: Critical
>         Attachments: YARN-3925.000.patch
>
>
> ContainerLogsUtils#getContainerLogFile fails to read files from full disks.
> {{getContainerLogFile}} depends on 
> {{LocalDirsHandlerService#getLogPathToRead}} to get the log file, but 
> {{LocalDirsHandlerService#getLogPathToRead}} calls 
> {{logDirsAllocator.getLocalPathToRead}} and {{logDirsAllocator}} uses 
> configuration {{YarnConfiguration.NM_LOG_DIRS}}, which will be updated to not 
> include full disks in {{LocalDirsHandlerService#checkDirs}}:
> {code}
>     Configuration conf = getConfig();
>     List<String> localDirs = getLocalDirs();
>     conf.setStrings(YarnConfiguration.NM_LOCAL_DIRS,
>                     localDirs.toArray(new String[localDirs.size()]));
>     List<String> logDirs = getLogDirs();
>     conf.setStrings(YarnConfiguration.NM_LOG_DIRS,
>                       logDirs.toArray(new String[logDirs.size()]));
> {code}
> ContainerLogsUtils#getContainerLogFile is used by NMWebServices#getLogs and 
> ContainerLogsPage.ContainersLogsBlock#render to read the log.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to