activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1524) ActiveMQServerControl.listAddresses() can fail with NullPointerException
Date Sat, 25 Nov 2017 15:19:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16265742#comment-16265742
] 

ASF GitHub Bot commented on ARTEMIS-1524:
-----------------------------------------

GitHub user pgfox opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1669

    ARTEMIS-1524 avoid null pointer due to race condition in listAddresses()

    The listAddresses() retrieves the list of addresses and then retrieves the detail of each
one to build the Json representation.  If the deleteAddress()  occurs between getting the
list of addresses and retrieving the details - a NullPointerException is thrown.
    
    If address is deleted, ignore that address and continue through the list.

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

    $ git pull https://github.com/pgfox/activemq-artemis listAddress_race

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

    https://github.com/apache/activemq-artemis/pull/1669.patch

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

    This closes #1669
    
----
commit 8a1b00cb3e99039ca7d34249b3320c0c09d11423
Author: Pat Fox <pat.g.fox@gmail.com>
Date:   2017-11-24T13:12:00Z

    ARTEMIS-1524 avoid null pointer due to race condition in listAddresses(). If address is
deleted, ignore that address and continue

----


> ActiveMQServerControl.listAddresses() can fail with NullPointerException
> ------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1524
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1524
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.4.0
>            Reporter: Pat Fox
>            Priority: Minor
>
> race condition between ActiveMQServerControl.listAddresses() and ActiveMQServerControl.deleteAddress()
that can result in the following NullPointerException
> {code}
> java.lang.NullPointerException: null
> 	at org.apache.activemq.artemis.core.management.impl.view.AddressView.toJson(Unknown
Source)
> 	at org.apache.activemq.artemis.core.management.impl.view.AddressView.toJson(Unknown
Source)
> 	at org.apache.activemq.artemis.core.management.impl.view.ActiveMQAbstractView.getResultsAsJson(ActiveMQAbstractView.java:68)
> 	at org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl.listAddresses(ActiveMQServerControlImpl.java:1743)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> {code}
> The listAddresses() retrieves the list of addresses and then retrieves the detail of
each one to build the Json representation. If the deleteAddress() happens between getting
the list and retrieving the details - a NullPointerException is thrown. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message