hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r979480 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/ZKDatabase.java
Date Mon, 26 Jul 2010 22:44:13 GMT
Author: mahadev
Date: Mon Jul 26 22:44:12 2010
New Revision: 979480

URL: http://svn.apache.org/viewvc?rev=979480&view=rev
Log:
ZOOKEEPER-783. committedLog in ZKDatabase is not properly synchronized (henry via mahadev)

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

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=979480&r1=979479&r2=979480&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Mon Jul 26 22:44:12 2010
@@ -69,6 +69,9 @@ BUGFIXES: 
   ZOOKEEPER-814. monitoring scripts are missing apache license headers
   (andrei savu via mahadev)
 
+  ZOOKEEPER-783. committedLog in ZKDatabase is not properly synchronized
+  (henry via mahadev) 
+
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 
   (phunt via mahadev)

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZKDatabase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZKDatabase.java?rev=979480&r1=979479&r2=979480&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZKDatabase.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/ZKDatabase.java Mon Jul
26 22:44:12 2010
@@ -104,7 +104,9 @@ public class ZKDatabase {
          */
         dataTree = new DataTree();
         sessionsWithTimeouts.clear();
-        committedLog.clear();
+        synchronized (committedLog) {
+            committedLog.clear();
+        }
         initialized = false;
     }
     
@@ -136,7 +138,9 @@ public class ZKDatabase {
     }
     
     public LinkedList<Proposal> getCommittedLog() {
-        return this.committedLog;
+        synchronized (this.committedLog) {
+            return new LinkedList<Proposal>(this.committedLog);
+        }
     }
     
     /**



Mime
View raw message