You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/02/21 15:36:31 UTC

svn commit: r1448655 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala

Author: chirino
Date: Thu Feb 21 14:36:31 2013
New Revision: 1448655

URL: http://svn.apache.org/r1448655
Log:
Fix for APLO-297: java.lang.IllegalArgumentException in recent snapshot

Synchronize access to the hash set.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala?rev=1448655&r1=1448654&r2=1448655&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala Thu Feb 21 14:36:31 2013
@@ -121,15 +121,19 @@ trait DelayingStoreSupport extends Store
     val owners = scala.collection.mutable.HashSet[String]()
 
     def release(owner: String) {
-      if( !owners.remove(owner) ) {
-        warn("UOW owner already removed! "+owner)
+      this.synchronized {
+        if( !owners.remove(owner) ) {
+          warn("UOW owner already removed! "+owner)
+        }
       }
       super.release()
     }
 
     def retain(owner: String) {
-      if( !owners.add(owner) ) {
-        warn("UOW owner already added! "+owner)
+      this.synchronized {
+        if( !owners.add(owner) ) {
+          warn("UOW owner already added! "+owner)
+        }
       }
       owners.add(owner)
       super.retain()