diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-03-20 15:16:13 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-03-20 15:16:13 +0000 |
| commit | 5c6817e0ae7e761fd654daa7e1ccdcc3f6709a0a (patch) | |
| tree | af64369613fdcd4ed2de27be110e860c920c7a9c /java | |
| parent | ad8bbfb1fe6aba57887450fa23af36e3e9575875 (diff) | |
| download | qpid-python-5c6817e0ae7e761fd654daa7e1ccdcc3f6709a0a.tar.gz | |
QPID-1763 : Fixed slow down due to fs lookup for unloaded message introduced in r748516
Merged from branches/0.5-release : r756506
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@756518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java index fceaf75a9e..715dd0c385 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java @@ -84,6 +84,7 @@ public class QueueEntryImpl implements QueueEntry private static final byte IMMEDIATE_AND_DELIVERED = (byte) (IMMEDIATE | DELIVERED_TO_CONSUMER); private boolean _persistent; + private boolean _hasBeenUnloaded = false; QueueEntryImpl(SimpleQueueEntryList queueEntryList) { @@ -407,11 +408,16 @@ public class QueueEntryImpl implements QueueEntry try { - _backingStore.unload(_message); - - if (_log.isDebugEnabled()) + if (!_hasBeenUnloaded) { - _log.debug("Unloaded:" + debugIdentity()); + _hasBeenUnloaded = true; + + _backingStore.unload(_message); + + if (_log.isDebugEnabled()) + { + _log.debug("Unloaded:" + debugIdentity()); + } } _message = null; @@ -502,7 +508,7 @@ public class QueueEntryImpl implements QueueEntry if (state != DELETED_STATE && _stateUpdater.compareAndSet(this, state, DELETED_STATE)) { _queueEntryList.advanceHead(); - if (_backingStore != null) + if (_backingStore != null && _hasBeenUnloaded) { _backingStore.delete(_messageId); } |
