ASF GitHub Bot commented on ARTEMIS-872:

GitHub user jbertram opened a pull request:


    ARTEMIS-872 fix negative space calculation


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-872

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1878
commit 1af544789b4af52afcf38654f4c3997b74226f29
Author: Justin Bertram <jbertram@...>
Date:   2018-02-19T17:59:24Z

    ARTEMIS-872 fix negative space calculation


> On extremely large volumes, Artemis falsely reports "Storage usage is beyond 
> max-disk-usage"
> --------------------------------------------------------------------------------------------
>                 Key: ARTEMIS-872
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-872
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.5.0
>            Reporter: Laurent Gauthier
>            Assignee: Justin Bertram
>            Priority: Major
> On Amazon EFS (Elastic File System) Java 8 reports the following for 
> UsableSpace and TotalSpace:
> usable=9,223,372,036,635,623,424
> total=   -9,223,372,036,854,775,808
> As one can see, the totalSpace is negative! We are past the Long.MAX_VALUE. 
> This results in 
> org.apache.activemq.artemis.core.server.files.FileStoreMonitor reporting an 
> error of type "Storage usage is beyond max-disk-usage" since it computes 
> usage (in method calculateUsage(FileStore store)) as:
> 1.0 - (double) store.getUsableSpace() / (double) store.getTotalSpace();
> so that "usage > maxUsage" resolves to True (maxUsage = 0.999 by default).
> This problem was already reported and discussed for ActiveMQ 5.x (see 
> External Issue URL) and a proposed fix was to use the following logic:
> if (totalSpace < 0) {
>       totalSpace = Long.MAX_VALUE;
>       } 
> The other proposal is to support a flag that would disable the usage check 
> altogether.

This message was sent by Atlassian JIRA

Reply via email to