Skip to content

Commit ddb59cd

Browse files
skysiderscnauroth
authored andcommitted
MAPREDUCE-7372 MapReduce set permission too late in copyJar method (#4026). Contributed by Zhang Dongsheng.
Reviewed-by: Steve Loughran <[email protected]> Signed-off-by: Chris Nauroth <[email protected]> (cherry picked from commit 9fe9623) (cherry picked from commit 1d2a60f)
1 parent 817b8fd commit ddb59cd

File tree

1 file changed

+3
-1
lines changed
  • hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce

1 file changed

+3
-1
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/JobResourceUploader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,11 @@ private URI useSharedCache(URI sourceFile, String resourceName,
784784
void copyJar(Path originalJarPath, Path submitJarFile,
785785
short replication) throws IOException {
786786
jtFs.copyFromLocalFile(originalJarPath, submitJarFile);
787-
jtFs.setReplication(submitJarFile, replication);
787+
// The operation of setReplication requires certain permissions
788+
// so we need to make sure it has enough permissions
788789
jtFs.setPermission(submitJarFile, new FsPermission(
789790
JobSubmissionFiles.JOB_FILE_PERMISSION));
791+
jtFs.setReplication(submitJarFile, replication);
790792
}
791793

792794
private void addLog4jToDistributedCache(Job job, Path jobSubmitDir)

0 commit comments

Comments
 (0)