mirror of https://github.com/apache/activemq.git
Updating temporary limit disk check to take into account space being used by the temporary store itself
This commit is contained in:
parent
226222546a
commit
4f8d56aaf6
|
@ -2023,16 +2023,19 @@ public class BrokerService implements Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
long storeLimit = usage.getTempUsage().getLimit();
|
long storeLimit = usage.getTempUsage().getLimit();
|
||||||
|
long storeCurrent = usage.getTempUsage().getUsage();
|
||||||
while (tmpDir != null && !tmpDir.isDirectory()) {
|
while (tmpDir != null && !tmpDir.isDirectory()) {
|
||||||
tmpDir = tmpDir.getParentFile();
|
tmpDir = tmpDir.getParentFile();
|
||||||
}
|
}
|
||||||
long dirFreeSpace = tmpDir.getUsableSpace();
|
long dirFreeSpace = tmpDir.getUsableSpace();
|
||||||
if (storeLimit > dirFreeSpace) {
|
if (storeLimit > (dirFreeSpace + storeCurrent)) {
|
||||||
LOG.warn("Temporary Store limit is " + storeLimit / (1024 * 1024) +
|
LOG.warn("Temporary Store limit is " + storeLimit / (1024 * 1024) +
|
||||||
" mb, whilst the temporary data directory: " + tmpDirPath +
|
" mb (current temporary store usage is " + storeCurrent / (1024 * 1024) +
|
||||||
" only has " + dirFreeSpace / (1024 * 1024) + " mb of usable space - resetting to maximum available " +
|
" mb). The temporary data directory: " + tmpDir.getAbsolutePath() +
|
||||||
dirFreeSpace / (1024 * 1024) + " mb.");
|
" only has " + dirFreeSpace / (1024 * 1024) +
|
||||||
usage.getTempUsage().setLimit(dirFreeSpace);
|
" mb of usable space - resetting to maximum available disk space: " +
|
||||||
|
(dirFreeSpace + storeCurrent) / (1024 * 1024) + " mb");
|
||||||
|
usage.getTempUsage().setLimit(dirFreeSpace + storeCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPersistent()) {
|
if (isPersistent()) {
|
||||||
|
|
Loading…
Reference in New Issue