hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r999777 - in /hadoop/zookeeper/branches/branch-3.3: CHANGES.txt src/java/main/org/apache/zookeeper/ClientCnxn.java
Date Wed, 22 Sep 2010 06:37:47 GMT
Author: phunt
Date: Wed Sep 22 06:37:46 2010
New Revision: 999777

URL: http://svn.apache.org/viewvc?rev=999777&view=rev
Log:
ZOOKEEPER-846. zookeeper client doesn't shut down cleanly on the close call

Modified:
    hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
    hadoop/zookeeper/branches/branch-3.3/src/java/main/org/apache/zookeeper/ClientCnxn.java

Modified: hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/CHANGES.txt?rev=999777&r1=999776&r2=999777&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.3/CHANGES.txt Wed Sep 22 06:37:46 2010
@@ -23,6 +23,9 @@ BUGFIXES:
   ZOOKEEPER-785. Zookeeper 3.3.1 shouldn't infinite loop if someone creates a
   server.0 line (part 2) (phunt)
 
+  ZOOKEEPER-846. zookeeper client doesn't shut down cleanly on the close call
+  (phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-789. Improve FLE log messages (flavio via phunt)

Modified: hadoop/zookeeper/branches/branch-3.3/src/java/main/org/apache/zookeeper/ClientCnxn.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/src/java/main/org/apache/zookeeper/ClientCnxn.java?rev=999777&r1=999776&r2=999777&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/src/java/main/org/apache/zookeeper/ClientCnxn.java
(original)
+++ hadoop/zookeeper/branches/branch-3.3/src/java/main/org/apache/zookeeper/ClientCnxn.java
Wed Sep 22 06:37:46 2010
@@ -1259,8 +1259,6 @@ public class ClientCnxn {
                       + Long.toHexString(getSessionId()));
         }
 
-        closing = true;
-
         try {
             RequestHeader h = new RequestHeader();
             h.setType(ZooDefs.OpCode.closeSession);
@@ -1308,9 +1306,14 @@ public class ClientCnxn {
             packet.ctx = ctx;
             packet.clientPath = clientPath;
             packet.serverPath = serverPath;
-            if (!zooKeeper.state.isAlive()) {
+            if (!zooKeeper.state.isAlive() || closing) {
                 conLossPacket(packet);
             } else {
+                // If the client is asking to close the session then
+                // mark as closing
+                if (h.getType() == OpCode.closeSession) {
+                    closing = true;
+                }
                 outgoingQueue.add(packet);
             }
         }



Mime
View raw message