activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1448655 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
Date Thu, 21 Feb 2013 14:36:31 GMT
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()



Mime
View raw message