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

ASF GitHub Bot commented on MAPREDUCE-7454:
-------------------------------------------

teamconfx opened a new pull request, #6049:
URL: https://github.com/apache/hadoop/pull/6049

   ### Description of PR
   https://issues.apache.org/jira/browse/MAPREDUCE-7454
   This PR adds a nullity check for the jobId when trying to acquire the appId, 
and also when trying to initialize the shared cache.
   
   ### How was this patch tested?
   1. set `mapreduce.job.sharedcache.mode=archives, 
mapreduce.framework.name=yarn, yarn.sharedcache.enabled=true`
   2. run 
`org.apache.hadoop.mapreduce.TestJobResourceUploader#testErasureCodingDisabled`
   The test does not throw `NullPointerException` any more, and gives more 
information about what is the problem.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   




> 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
>         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