Author: dhruba
Date: Tue Feb 12 21:55:38 2008
New Revision: 627257

URL: http://svn.apache.org/viewvc?rev=627257&view=rev
Log:
HADOOP-2789. Fix a  bug in the IPC responder thread while cancelling keys from 
the
socket selector.
svn merge -c 627254 from trunk.


Modified:
    hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/ipc/Server.java

Modified: 
hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/ipc/Server.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/ipc/Server.java?rev=627257&r1=627256&r2=627257&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/ipc/Server.java 
(original)
+++ hadoop/core/branches/branch-0.16/src/java/org/apache/hadoop/ipc/Server.java 
Tue Feb 12 21:55:38 2008
@@ -550,21 +550,21 @@
         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;
+            }            
           }
         }
       }


Reply via email to