hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r886960 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java
Date Thu, 03 Dec 2009 22:30:45 GMT
Author: mahadev
Date: Thu Dec  3 22:30:44 2009
New Revision: 886960

URL: http://svn.apache.org/viewvc?rev=886960&view=rev
Log:
ZOOKEEPER-597. ASyncHammerTest is failing intermittently on hudson trunk (take 4) (breed via
mahadev)

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

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=886960&r1=886959&r2=886960&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Thu Dec  3 22:30:44 2009
@@ -145,6 +145,9 @@
   ZOOKEEPER-597. ASyncHammerTest is failing intermittently on hudson trunk
   (take 3) (phunt via mahadev)
 
+  ZOOKEEPER-597. ASyncHammerTest is failing intermittently on hudson trunk
+  (take 4) (breed via mahadev)
+
 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/NIOServerCnxn.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java?rev=886960&r1=886959&r2=886960&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java Thu
Dec  3 22:30:44 2009
@@ -71,6 +71,13 @@
 
     private ConnectionBean jmxConnectionBean;
 
+    static {
+        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            public void uncaughtException(Thread t, Throwable e) {
+                LOG.error("Thread " + t + " died", e);
+            }
+        });
+    }
 
     static public class Factory extends Thread {
         ZooKeeperServer zks;
@@ -937,8 +944,6 @@
         return "NIOServerCnxn object with sock = " + sock + " and sk = " + sk;
     }
 
-    boolean closed;
-
     /*
      * (non-Javadoc)
      *
@@ -955,12 +960,6 @@
         }
         jmxConnectionBean = null;
 
-        synchronized(this) {
-            if (closed) {
-                return;
-            }
-            closed = true;
-        }
         synchronized (factory.ipMap)
         {
             Set<NIOServerCnxn> s = factory.ipMap.get(sock.socket().getInetAddress());
@@ -1041,14 +1040,6 @@
      */
     synchronized public void sendResponse(ReplyHeader h, Record r, String tag) {
         try {
-            if (closed) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("send called on closed session 0x"
-                              + Long.toHexString(sessionId)
-                              + " with record " + r);
-                }
-                return;
-            }
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             // Make space for length
             BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos);
@@ -1078,7 +1069,7 @@
                 }
             }
          } catch(Exception e) {
-            LOG.error("Unexpected exception. Destruction averted.", e);
+            LOG.warn("Unexpected exception. Destruction averted.", e);
          }
     }
 



Mime
View raw message