activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5967
Date Mon, 14 Sep 2015 19:50:39 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.12.x f5b83cbc8 -> 448109642


https://issues.apache.org/jira/browse/AMQ-5967

Updating temporary limit disk check to take into account space being
used by the temporary store itself

(cherry picked from commit 4f8d56aaf60f99abe643e79c6c4940a571289a86)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/44810964
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/44810964
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/44810964

Branch: refs/heads/activemq-5.12.x
Commit: 44810964284bee17eb95b8ef3d20b3f760c17852
Parents: f5b83cb
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Mon Sep 14 19:46:57 2015 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Mon Sep 14 19:49:49 2015 +0000

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/BrokerService.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/44810964/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 5c12069..8ad56a7 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
@@ -2023,16 +2023,19 @@ public class BrokerService implements Service {
             }
 
             long storeLimit = usage.getTempUsage().getLimit();
+            long storeCurrent = usage.getTempUsage().getUsage();
             while (tmpDir != null && !tmpDir.isDirectory()) {
                 tmpDir = tmpDir.getParentFile();
             }
             long dirFreeSpace = tmpDir.getUsableSpace();
-            if (storeLimit > dirFreeSpace) {
+            if (storeLimit > (dirFreeSpace + storeCurrent)) {
                 LOG.warn("Temporary Store limit is " + storeLimit / (1024 * 1024) +
-                        " mb, whilst the temporary data directory: " + tmpDirPath +
-                        " only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space
- resetting to maximum available " +
-                        dirFreeSpace / (1024 * 1024) + " mb.");
-                usage.getTempUsage().setLimit(dirFreeSpace);
+                        " mb (current temporary store usage is " + storeCurrent / (1024 *
1024) +
+                        " mb). The temporary data directory: " + tmpDir.getAbsolutePath()
+
+                        " only has " + dirFreeSpace / (1024 * 1024) +
+                        " mb of usable space - resetting to maximum available disk space:
" +
+                       (dirFreeSpace + storeCurrent) / (1024 * 1024) + " mb");
+               usage.getTempUsage().setLimit(dirFreeSpace + storeCurrent);
             }
 
             if (isPersistent()) {


Mime
View raw message