Explorar el Código

Fix a bug in the IPC responder thread while cancelling keys from the
socket selector.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@627254 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur hace 17 años
padre
commit
9febb0ab73
Se han modificado 1 ficheros con 10 adiciones y 10 borrados
  1. 10 10
      src/java/org/apache/hadoop/ipc/Server.java

+ 10 - 10
src/java/org/apache/hadoop/ipc/Server.java

@@ -550,21 +550,21 @@ public abstract class Server {
         Iterator<Call> iter = responseQueue.listIterator(0);
         while (iter.hasNext()) {
           call = iter.next();
-          if (call.response.position() > 0) {
-            /* We should probably use a different a different start time 
-             * than receivedTime. receivedTime starts when the RPC
-             * was first read.
-             * We have written a partial response. will close the
-             * connection for now.
-             */
-            close = true;
-            break;
-          }
           if (now > call.receivedTime + maxCallStartAge) {
             LOG.info(getName() + ", call " + call +
                      ": response discarded for being too old (" +
                      (now - call.receivedTime) + ")");
             iter.remove();
+            if (call.response.position() > 0) {
+              /* We should probably use a different start time 
+               * than receivedTime. receivedTime starts when the RPC
+               * was first read.
+               * We have written a partial response. will close the
+               * connection for now.
+               */
+              close = true;
+              break;
+            }            
           }
         }
       }