hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingliang Liu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-14631) Distcp should add a default atomicWorkPath properties when using atomic or throw obvious Exception
Date Sat, 08 Jul 2017 04:43:01 GMT

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

Mingliang Liu commented on HADOOP-14631:
----------------------------------------

Hi [~Hongyuan Li], thanks for filing this. I'd suggest we use a default workPath in case it's
not set. NPE currently definitely is bad.

> Distcp should add a default  atomicWorkPath properties when using atomic or throw obvious
Exception
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-14631
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14631
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.7.3, 3.0.0-alpha3
>            Reporter: Hongyuan Li
>            Assignee: Hongyuan Li
>
> Distcp should add a default  AtomicWorkPath properties when using atomic
> {{Distcp}}#{{configureOutputFormat}} using code below to generate atomic work path,
> {code}
>     if (context.shouldAtomicCommit()) {
>       Path workDir = context.getAtomicWorkPath();
>       if (workDir == null) {
>         workDir = targetPath.getParent();
>       }
>       workDir = new Path(workDir, WIP_PREFIX + targetPath.getName()
>                                 + rand.nextInt());
> {code}
> When atomic is set and {{AtomicWorkPath}} == null, distcp will get the parent of current
{{WorkDir}}. In this case, if {{workdir}} is {{"/"}}, the parent will be {{null}}, wich means

> {{workDir = new Path(workDir, WIP_PREFIX + targetPath.getName() + rand.nextInt());}}
will throw a nullpoint exception.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message