mirror of https://github.com/apache/activemq.git
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
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@986734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
815c2f32bc
commit
c5da5f829a
|
@ -159,7 +159,10 @@ public class AMQMessageStore extends AbstractMessageStore {
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class AMQ2584Test extends org.apache.activemq.TestSupport {
|
|||
public void initCombosForTestSize() throws Exception {
|
||||
this.addCombinationValues("defaultPersistenceAdapter",
|
||||
new Object[]{
|
||||
// PersistenceAdapterChoice.AMQ,
|
||||
PersistenceAdapterChoice.AMQ,
|
||||
PersistenceAdapterChoice.KahaDB
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue