hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f..@apache.org
Subject svn commit: r921853 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
Date Thu, 11 Mar 2010 14:05:16 GMT
Author: fpj
Date: Thu Mar 11 14:05:15 2010
New Revision: 921853

URL: http://svn.apache.org/viewvc?rev=921853&view=rev
Log:
ZOOKEEPER-511. bad error handling in FollowerHandle.sendPackets (mahadev via flavio)


Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=921853&r1=921852&r2=921853&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Thu Mar 11 14:05:15 2010
@@ -267,6 +267,9 @@ BUGFIXES: 
   ZOOKEEPER-696. NPE in the hudson logs, seems nioservercnxn closed twice 
   (phunt via mahadev)
 
+  ZOOKEEPER-511. bad error handling in FollowerHandler.sendPackets
+  (mahadev via flavio)
+
 IMPROVEMENTS:
   ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to
   "socket reuse" and failure to close client (phunt via mahadev)

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java?rev=921853&r1=921852&r2=921853&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
Thu Mar 11 14:05:15 2010
@@ -139,7 +139,15 @@ public class LearnerHandler extends Thre
                 oa.writeRecord(p, "packet");
             } catch (IOException e) {
                 if (!sock.isClosed()) {
-                    LOG.warn("Unexpected exception",e);
+                    LOG.warn("Unexpected exception at " + this, e);
+                    try {
+                        // this will cause everything to shutdown on
+                        // this learner handler and will help notify
+                        // the learner/observer instantaneously
+                        sock.close();
+                    } catch(IOException ie) {
+                        LOG.warn("Error closing socket for handler " + this, ie);
+                    }
                 }
                 break;
             }



Mime
View raw message