Skip to content

Commit

Permalink
MAPREDUCE-7372 MapReduce set permission too late in copyJar method (#…
Browse files Browse the repository at this point in the history
…4026). Contributed by Zhang Dongsheng.

Reviewed-by: Steve Loughran <[email protected]>
Signed-off-by: Chris Nauroth <[email protected]>
(cherry picked from commit 9fe9623)
  • Loading branch information
skysiders authored and cnauroth committed Jul 25, 2022
1 parent fffb0bd commit 1d2a60f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,11 @@ private URI useSharedCache(URI sourceFile, String resourceName,
void copyJar(Path originalJarPath, Path submitJarFile,
short replication) throws IOException {
jtFs.copyFromLocalFile(originalJarPath, submitJarFile);
jtFs.setReplication(submitJarFile, replication);
// The operation of setReplication requires certain permissions
// so we need to make sure it has enough permissions
jtFs.setPermission(submitJarFile, new FsPermission(
JobSubmissionFiles.JOB_FILE_PERMISSION));
jtFs.setReplication(submitJarFile, replication);
}

private void addLog4jToDistributedCache(Job job, Path jobSubmitDir)
Expand Down

0 comments on commit 1d2a60f

Please sign in to comment.