[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated MAPREDUCE-7454:
--------------------------------------
    Labels: pull-request-available  (was: )

> missing checking for null when acquiring appId for a null jobId
> ---------------------------------------------------------------
>
>                 Key: MAPREDUCE-7454
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7454
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>            Reporter: ConfX
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: reproduce.sh
>
>
> h2. What happened?
> null pointer exception is triggered when trying to acquire appId for a null 
> jobId 
> h2. Where's the bug?
> In line 90 of JobResourceUploader.java:
> {code:java}
> private ApplicationId jobIDToAppId(JobID jobId) {
>     return ApplicationId.newInstance(Long.parseLong(jobId.getJtIdentifier()),
>         jobId.getId());
>   }
> {code}
> Here the jobId is not checked before generating the `ApplicationId` for it.
> h2. How to reproduce?
> 1. set {{mapreduce.job.sharedcache.mode=archives, 
> mapreduce.framework.name=yarn, yarn.sharedcache.enabled=true}}
> 2. run 
> {{org.apache.hadoop.mapreduce.TestJobResourceUploader#testErasureCodingDisabled}}
> and observe this exception:
> {code:java}
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.mapreduce.JobResourceUploader.jobIDToAppId(JobResourceUploader.java:91)
>       at 
> org.apache.hadoop.mapreduce.JobResourceUploader.initSharedCache(JobResourceUploader.java:79)
>       at 
> org.apache.hadoop.mapreduce.JobResourceUploader.uploadResources(JobResourceUploader.java:134)
>       at 
> org.apache.hadoop.mapreduce.TestJobResourceUploader.testErasureCodingSetting(TestJobResourceUploader.java:442)
>       at 
> org.apache.hadoop.mapreduce.TestJobResourceUploader.testErasureCodingDisabled(TestJobResourceUploader.java:380)
> {code}
> For an easy reproduction, run the {{reproduce.sh}} in the attachment.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-h...@hadoop.apache.org

Reply via email to