hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f..@apache.org
Subject svn commit: r833932 - in /hadoop/zookeeper/trunk: CHANGES.txt src/c/src/zookeeper.c src/java/main/org/apache/zookeeper/ClientCnxn.java
Date Sun, 08 Nov 2009 21:41:14 GMT
Author: fpj
Date: Sun Nov  8 21:41:13 2009
New Revision: 833932

URL: http://svn.apache.org/viewvc?rev=833932&view=rev
Log:
ZOOKEEPER-551. unnecessary SetWatches message on new session (phunt via flavio)


Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/c/src/zookeeper.c
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=833932&r1=833931&r2=833932&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Sun Nov  8 21:41:13 2009
@@ -103,6 +103,9 @@
   ZOOKEEPER-537. The zookeeper jar includes the java source files
   (Thomas Dudziak via phunt)
 
+  ZOOKEEPER-551. unnecessary SetWatches message on new session.
+  (phunt 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/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/c/src/zookeeper.c?rev=833932&r1=833931&r2=833932&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ hadoop/zookeeper/trunk/src/c/src/zookeeper.c Sun Nov  8 21:41:13 2009
@@ -1170,6 +1170,12 @@
     struct SetWatches req;
     int rc;
 
+    // return if there are no pending watches
+    if (!req.dataWatches.count && !req.existWatches.count &&
+        !req.childWatches.count) {
+        return ZOK;
+    }
+
     oa = create_buffer_oarchive();
     req.relativeZxid = zh->last_zxid;
     req.dataWatches.data = collect_keys(zh->active_node_watchers, &req.dataWatches.count);

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java?rev=833932&r1=833931&r2=833932&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java Sun Nov  8 21:41:13
2009
@@ -851,7 +851,12 @@
             bb.rewind();
             synchronized (outgoingQueue) {
                 // We add backwards since we are pushing into the front
-                if (!disableAutoWatchReset) {
+                // Only send if there's a pending watch
+                if (!disableAutoWatchReset &&
+                        (!zooKeeper.getDataWatches().isEmpty()
+                         || !zooKeeper.getExistWatches().isEmpty()
+                         || !zooKeeper.getChildWatches().isEmpty()))
+                {
                     SetWatches sw = new SetWatches(lastZxid,
                             zooKeeper.getDataWatches(),
                             zooKeeper.getExistWatches(),



Mime
View raw message