[
https://issues.apache.org/jira/browse/AMQ-7017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16559617#comment-16559617
]
ASF subversion and git services commented on AMQ-7017:
------------------------------------------------------
Commit e3f76e169325f4741c4ddf0c38c10ca65fa1c385 in activemq's branch
refs/heads/activemq-5.15.x from Christopher L. Shannon (cshannon)
[ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=e3f76e1 ]
AMQ-7017 - Prevent ArithmeticException in ProducerBrokerExchange
Check for zero to prevent divide by zero error inside
getPercentageBlocked() method
Thank you to Matthew Stratton for the patch
(cherry picked from commit b79fcd0a768e5c7d45a7f68febf447d8379cbaf4)
> ProducerBrokerExchange.getPercentageBlocked() throws ArithmeticException
> (divide by zero)
> -----------------------------------------------------------------------------------------
>
> Key: AMQ-7017
> URL: https://issues.apache.org/jira/browse/AMQ-7017
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Affects Versions: 5.15.4
> Reporter: Matthew Stratton
> Assignee: Christopher L. Shannon
> Priority: Trivial
> Labels: patch
> Fix For: 5.16.0, 5.15.5
>
> Attachments: fix-producer-exchange-divide-by-zero.txt
>
>
> I found this when testing a broker plugin for tracking messages sent
> (including some stats like getPercentageBlocked). When there have been no
> blocked messages an ArithmeticException is thrown due to an unchecked divide
> by zero.
> I fixed it and added a couple unit tests.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)