Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95BD410E1D for ; Thu, 31 Oct 2013 21:16:52 +0000 (UTC) Received: (qmail 94420 invoked by uid 500); 31 Oct 2013 21:16:52 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 94391 invoked by uid 500); 31 Oct 2013 21:16:52 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 94384 invoked by uid 99); 31 Oct 2013 21:16:52 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 21:16:52 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2BF226934; Thu, 31 Oct 2013 21:16:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtully@apache.org To: commits@activemq.apache.org Message-Id: <8ddcbe898349478b821640be608cfa22@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: https://issues.apache.org/jira/browse/AMQ-4832 - apply patch from Matthew Walker with thanks Date: Thu, 31 Oct 2013 21:16:51 +0000 (UTC) Updated Branches: refs/heads/trunk 582af3e74 -> 855419359 https://issues.apache.org/jira/browse/AMQ-4832 - apply patch from Matthew Walker with thanks Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/85541935 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/85541935 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/85541935 Branch: refs/heads/trunk Commit: 855419359cefbdb31be38510db121b17170af42d Parents: 582af3e Author: gtully Authored: Thu Oct 31 21:16:17 2013 +0000 Committer: gtully Committed: Thu Oct 31 21:16:17 2013 +0000 ---------------------------------------------------------------------- .../java/org/apache/activemq/broker/BrokerService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/85541935/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java index eecab9d..575e313 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -1908,14 +1908,16 @@ public class BrokerService implements Service { dir = dir.getParentFile(); } long storeLimit = usage.getStoreUsage().getLimit(); + long storeCurrent = usage.getStoreUsage().getUsage(); long dirFreeSpace = dir.getUsableSpace(); - if (storeLimit > dirFreeSpace) { + if (storeLimit > (dirFreeSpace + storeCurrent)) { LOG.warn("Store limit is " + storeLimit / (1024 * 1024) + - " mb, whilst the data directory: " + dir.getAbsolutePath() + + " mb (current store usage is " + storeCurrent / (1024 * 1024) + + " mb). The data directory: " + dir.getAbsolutePath() + " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space - resetting to maximum available disk space: " + - dirFreeSpace / (1024 * 1024) + " mb"); - usage.getStoreUsage().setLimit(dirFreeSpace); + (dirFreeSpace + storeCurrent) / (1024 * 1024) + " mb"); + usage.getStoreUsage().setLimit(dirFreeSpace + storeCurrent); } }