Explorar o código

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 %!s(int64=18) %!d(string=hai) anos
pai
achega
b93f4dfe69
Modificáronse 2 ficheiros con 7 adicións e 0 borrados
  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
     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
 

+ 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
             //incremented)!
             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;
           }
           failures++;