Skip to content

Commit 1d2a60f

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)
1 parent fffb0bd commit 1d2a60f

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
@@ -783,9 +783,11 @@ private URI useSharedCache(URI sourceFile, String resourceName,
783783
void copyJar(Path originalJarPath, Path submitJarFile,
784784
short replication) throws IOException {
785785
jtFs.copyFromLocalFile(originalJarPath, submitJarFile);
786-
jtFs.setReplication(submitJarFile, replication);
786+
// The operation of setReplication requires certain permissions
787+
// so we need to make sure it has enough permissions
787788
jtFs.setPermission(submitJarFile, new FsPermission(
788789
JobSubmissionFiles.JOB_FILE_PERMISSION));
790+
jtFs.setReplication(submitJarFile, replication);
789791
}
790792

791793
private void addLog4jToDistributedCache(Job job, Path jobSubmitDir)

0 commit comments

Comments
 (0)