You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "nabarun (JIRA)" <ji...@apache.org> on 2018/10/03 21:38:43 UTC

[jira] [Closed] (GEODE-5281) Race between registering and unregistering CustomMXBeans in concurrent thread may result in NPE

     [ https://issues.apache.org/jira/browse/GEODE-5281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nabarun closed GEODE-5281.
--------------------------

> Race between registering and unregistering CustomMXBeans in concurrent thread may result in NPE
> -----------------------------------------------------------------------------------------------
>
>                 Key: GEODE-5281
>                 URL: https://issues.apache.org/jira/browse/GEODE-5281
>             Project: Geode
>          Issue Type: Bug
>          Components: jmx
>    Affects Versions: 1.0.0-incubating
>            Reporter: Kenneth Howe
>            Assignee: Kenneth Howe
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Stack trace from an example of the unexpected NullPointerException in {{MBeanProxyFactory.createProxy()}}
> {code:java}
> [warning 2018/02/03 17:32:13.561 UTC managing_1_gemfire2_79a23c4a-f5e3-4c9f-6455-149c397ce13c_38199 <pool-3-thread-4> tid=0x5e] Create Proxy failed for GemFire:type=CustomMXBean213,member=locator_managing_gemfire1_79a23c4a-f5e3-4c9f-6455-149c397ce13c_37116 with exception null
> java.lang.NullPointerException
>         at org.apache.geode.management.internal.MBeanProxyFactory.createProxy(MBeanProxyFactory.java:83)
>         at org.apache.geode.management.internal.MBeanProxyFactory.createAllProxies(MBeanProxyFactory.java:137)
>         at org.apache.geode.management.internal.FederatingManager$GIITask.call(FederatingManager.java:457)
>         at org.apache.geode.management.internal.FederatingManager$GIITask.call(FederatingManager.java:341)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> {code}
> The registering thread enters 
> {code}
>   public void createProxy(DistributedMember member, ObjectName objectName,
>       Region<String, Object> monitoringRegion, Object newVal) {
> {code}
> with the {{objectName}} existing in the {{_monitoringRegion}}. A few lines further the entry is retrieved from the region, but is now {{null}} due to it being removed by the unregistering thread.
> {code}
>       String name = objectName.toString();
>       FederationComponent federationComponent = (FederationComponent) monitoringRegion.get(name);
>       String interfaceClassName = federationComponent.getMBeanInterfaceClass();
> {code}
> {{federationComponent == null}} results in the NPE.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)