activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r986734 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/store/amq/AMQMessageStore.java test/java/org/apache/activemq/bugs/AMQ2584Test.java
Date Wed, 18 Aug 2010 15:20:15 GMT
Author: gtully
Date: Wed Aug 18 15:20:15 2010
New Revision: 986734

URL: http://svn.apache.org/viewvc?rev=986734&view=rev
Log:
resolve https://issues.apache.org/activemq/browse/AMQ-2584 for AMQ store, if a write was outstanding
when a second add arrives, the addition was ignored but the additonal file reference was not
ignored leading to a dangling ref to a data file that prevented it being reclaimed

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java?rev=986734&r1=986733&r2=986734&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
Wed Aug 18 15:20:15 2010
@@ -159,7 +159,10 @@ public class AMQMessageStore extends Abs
         lock.lock();
         try {
             lastLocation = location;
-            messages.put(message.getMessageId(), data);
+            ReferenceData prev = messages.put(message.getMessageId(), data);
+            if (prev != null) {
+                AMQMessageStore.this.peristenceAdapter.removeInProgressDataFile(AMQMessageStore.this,
prev.getFileId());
+            }
         } finally {
             lock.unlock();
         }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java?rev=986734&r1=986733&r2=986734&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java Wed
Aug 18 15:20:15 2010
@@ -57,7 +57,7 @@ public class AMQ2584Test extends org.apa
     public void initCombosForTestSize() throws Exception {
         this.addCombinationValues("defaultPersistenceAdapter",
                 new Object[]{
-                        // PersistenceAdapterChoice.AMQ,
+                        PersistenceAdapterChoice.AMQ,
                         PersistenceAdapterChoice.KahaDB
                 });
     }



Mime
View raw message