فهرست منبع

commit 2dd37053e358934dc7e81378d793c395cb0f759e
Author: Jitendra Nath Pandey <jitendra@sufferhome-lm.(none)>
Date: Mon Sep 20 19:51:51 2010 -0700

MAPREDUCE-2082 from https://issues.apache.org/jira/secure/attachment/12455109/MAPREDUCE-2082-y20.1.patch

+++ b/YAHOO-CHANGES.txt
+
+ MAPREDUCE-2082 Race condition in writing the jobtoken password file when
+ launching pipes jobs (jitendra and ddas)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077720 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 سال پیش
والد
کامیت
0b419fc4ae
1فایلهای تغییر یافته به همراه1 افزوده شده و 5 حذف شده
  1. 1 5
      src/mapred/org/apache/hadoop/mapred/pipes/Application.java

+ 1 - 5
src/mapred/org/apache/hadoop/mapred/pipes/Application.java

@@ -101,7 +101,7 @@ class Application<K1 extends WritableComparable, V1 extends Writable,
     // This password is used as shared secret key between this application and
     // child pipes process
     byte[]  password = jobToken.getPassword();
-    String localPasswordFile = conf.getJobLocalDir() + Path.SEPARATOR
+    String localPasswordFile = new File(".") + Path.SEPARATOR
         + "jobTokenPassword";
     writePasswordToLocalFile(localPasswordFile, password, conf);
     env.put("hadoop.pipes.shared.secret.location", localPasswordFile);
@@ -167,10 +167,6 @@ class Application<K1 extends WritableComparable, V1 extends Writable,
       byte[] password, JobConf conf) throws IOException {
     FileSystem localFs = FileSystem.getLocal(conf);
     Path localPath = new Path(localPasswordFile);
-    if (localFs.isFile(localPath)) {
-      LOG.debug("Password file is already created by previous path");
-      return;
-    }
     FSDataOutputStream out = FileSystem.create(localFs, localPath,
         new FsPermission("400"));
     out.write(password);