1
0
Quellcode durchsuchen

HADOOP-1049. Fix a race condition in IPC client. Contributed by Devaraj.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@513968 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting vor 18 Jahren
Ursprung
Commit
b93f4dfe69
2 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 3 0
      CHANGES.txt
  2. 4 0
      src/java/org/apache/hadoop/ipc/Client.java

+ 3 - 0
CHANGES.txt

@@ -189,6 +189,9 @@ Trunk (unreleased changes)
     this developers must download the (LGPL'd) checkstyle jar
     this developers must download the (LGPL'd) checkstyle jar
     themselves.  (tomwhite via cutting)
     themselves.  (tomwhite via cutting)
 
 
+58. HADOOP-1049.  Fix a race condition in IPC client.
+    (Devaraj Das via cutting)
+
 
 
 Release 0.11.2 - 2007-02-16
 Release 0.11.2 - 2007-02-16
 
 

+ 4 - 0
src/java/org/apache/hadoop/ipc/Client.java

@@ -155,6 +155,10 @@ public class Client {
             //inUse to infinity (everytime getConnection is called inUse is
             //inUse to infinity (everytime getConnection is called inUse is
             //incremented)!
             //incremented)!
             inUse = 0;
             inUse = 0;
+            // set socket to null so that the next call to setupIOstreams
+            // can start the process of connect all over again.
+            socket.close();
+            socket = null;
             throw ie;
             throw ie;
           }
           }
           failures++;
           failures++;