mirror of https://github.com/apache/activemq.git
AMQ-1962 - ensure size is not calculated on stop after store has shutdown
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@701118 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b22832e2d8
commit
5d9351846c
|
@ -65,8 +65,8 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
|
||||||
public final synchronized void stop() throws Exception {
|
public final synchronized void stop() throws Exception {
|
||||||
getSystemUsage().getMemoryUsage().removeUsageListener(this);
|
getSystemUsage().getMemoryUsage().removeUsageListener(this);
|
||||||
resetBatch();
|
resetBatch();
|
||||||
gc();
|
|
||||||
super.stop();
|
super.stop();
|
||||||
|
gc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,7 +194,11 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
|
||||||
batchList.clear();
|
batchList.clear();
|
||||||
batchResetNeeded = true;
|
batchResetNeeded = true;
|
||||||
this.cacheEnabled=false;
|
this.cacheEnabled=false;
|
||||||
size = getStoreSize();
|
if (isStarted()) {
|
||||||
|
size = getStoreSize();
|
||||||
|
} else {
|
||||||
|
size = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final synchronized void fillBatch() {
|
protected final synchronized void fillBatch() {
|
||||||
|
|
|
@ -77,13 +77,13 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
|
||||||
|
|
||||||
public synchronized void stop() throws Exception {
|
public synchronized void stop() throws Exception {
|
||||||
started = false;
|
started = false;
|
||||||
super.stop();
|
|
||||||
if (nonPersistent != null) {
|
if (nonPersistent != null) {
|
||||||
nonPersistent.stop();
|
nonPersistent.stop();
|
||||||
nonPersistent.gc();
|
nonPersistent.gc();
|
||||||
}
|
}
|
||||||
persistent.stop();
|
persistent.stop();
|
||||||
persistent.gc();
|
persistent.gc();
|
||||||
|
super.stop();
|
||||||
pendingCount = 0;
|
pendingCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue