浏览代码

Merging change r1098837 from branch-0.20-security

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-203@1098844 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 14 年之前
父节点
当前提交
68e100e719

+ 11 - 0
CHANGES.txt

@@ -1677,6 +1677,11 @@ Release 0.20.2 - Unreleased
     before it constructs and sends its own ack message for the packet.
     (hairong)
 
+    HDFS-723. Fix deadlock in DFSClient#DFSOutputStream. (hairong)
+
+    HDFS-732. DFSClient.DFSOutputStream.close() should throw an exception if
+    the stream cannot be closed successfully.  (szetszwo)
+
   IMPROVEMENTS
 
     HDFS-187. Initialize secondary namenode http address in TestStartup.
@@ -1685,6 +1690,12 @@ Release 0.20.2 - Unreleased
     HDFS-185. Disallow chown, chgrp, chmod, setQuota, and setSpaceQuota when
     name-node is in safemode. (Ravi Phulari via shv)
 
+    HADOOP-5611. Fix C++ libraries to build on Debian Lenny. (Todd Lipcon
+    via tomwhite)
+
+    HADOOP-5612. Some c++ scripts are not chmodded before ant execution.
+    (Todd Lipcon via tomwhite)
+
     HDFS-579. Fix DfsTask to follow the semantics of 0.19, regarding non-zero
     return values as failures. (Christian Kunz via cdouglas)
 

+ 3 - 0
build.xml

@@ -1768,6 +1768,7 @@
   <target name="create-c++-utils-makefile" depends="check-c++-makefiles" 
                                            if="need.c++.utils.makefile">
     <mkdir dir="${build.c++.utils}"/>
+    <chmod file="${c++.utils.src}/configure" perm="ugo+x"/>
     <exec executable="${c++.utils.src}/configure" dir="${build.c++.utils}"
           failonerror="yes">
       <arg value="--prefix=${install.c++}"/>
@@ -1785,6 +1786,7 @@
   <target name="create-c++-pipes-makefile" depends="check-c++-makefiles" 
                                            if="need.c++.pipes.makefile">
     <mkdir dir="${build.c++.pipes}"/>
+    <chmod file="${c++.pipes.src}/configure" perm="ugo+x"/>
     <exec executable="${c++.pipes.src}/configure" dir="${build.c++.pipes}"
           failonerror="yes">
       <arg value="--prefix=${install.c++}"/>
@@ -1807,6 +1809,7 @@
           depends="check-c++-makefiles" 
           if="need.c++.examples.pipes.makefile">
     <mkdir dir="${build.c++.examples.pipes}"/>
+    <chmod file="${c++.examples.pipes.src}/configure" perm="ugo+x"/>
     <exec executable="${c++.examples.pipes.src}/configure" 
           dir="${build.c++.examples.pipes}"
           failonerror="yes">

+ 1 - 0
src/c++/pipes/impl/HadoopPipes.cc

@@ -28,6 +28,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <strings.h>
 #include <sys/socket.h>
 #include <pthread.h>

+ 1 - 0
src/c++/utils/impl/SerialUtils.cc

@@ -22,6 +22,7 @@
 #include <rpc/types.h>
 #include <rpc/xdr.h>
 #include <string>
+#include <string.h>
 
 using std::string;
 

+ 2 - 0
src/c++/utils/impl/StringUtils.cc

@@ -21,6 +21,8 @@
 #include <errno.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <strings.h>
 #include <sys/time.h>
 

+ 18 - 6
src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

@@ -1107,10 +1107,17 @@ public class DFSClient implements FSConstants, java.io.Closeable {
       }
     }
 
-    synchronized void close() {
-      while (!pendingCreates.isEmpty()) {
-        String src = pendingCreates.firstKey();
-        OutputStream out = pendingCreates.remove(src);
+    void close() {
+      while (true) {
+        String src;
+        OutputStream out;
+        synchronized (this) {
+          if (pendingCreates.isEmpty()) {
+            return;
+          }
+          src = pendingCreates.firstKey();
+          out = pendingCreates.remove(src);
+        }
         if (out != null) {
           try {
             out.close();
@@ -3338,8 +3345,13 @@ public class DFSClient implements FSConstants, java.io.Closeable {
      */
     @Override
     public void close() throws IOException {
-      if(closed)
-        return;
+      if (closed) {
+        IOException e = lastException;
+        if (e == null)
+          return;
+        else
+          throw e;
+      }
       closeInternal();
       leasechecker.remove(src);