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

zhihai xu commented on HADOOP-12252:
------------------------------------

thanks [~xgong] for the review. Normally we won't see this issue, as you said 
the default value should not be empty string. But there is a usage case at 
LocalDirsHandlerService, we will change NM_LOCAL_DIRS/NM_LOG_DIRS after disk 
check.
{code}
    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}
Potentially all disks can be full, although it should very rarely happen. But 
if it happens, NM_LOCAL_DIRS/NM_LOG_DIRS will be set to empty string and this 
issue my happen.
By the way, I find this issue when I worked on the patch at YARN-3925, the test 
case at YARN-3925 can also reproduce this issue.
Since this issue rarely happens, I will change its priority to minor.

> LocalDirAllocator should not throw NPE with empty string configuration. 
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-12252
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12252
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>         Attachments: HADOOP-12252.000.patch
>
>
> LocalDirAllocator should not throw NPE with empty string configuration. When 
> an empty string is configured, {{LocalDirAllocator}} will throw NPE. It will 
> be better to throw IOException instead of NPE.



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

Reply via email to