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

[jira] [Resolved] (GEODE-5252) Race in management adapter could fail to create MXBeans.

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

xiaojian zhou resolved GEODE-5252.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.8.0

Fixed in cc6f0de3796241d940064f405fca3eb6711f4784

> Race in management adapter could fail to create MXBeans.
> --------------------------------------------------------
>
>                 Key: GEODE-5252
>                 URL: https://issues.apache.org/jira/browse/GEODE-5252
>             Project: Geode
>          Issue Type: Bug
>          Components: management
>            Reporter: Sai Boorlagadda
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.8.0
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Handling DiskStore creation event to create DiskStoreMXBean could result into a null pointer due to race in ManagementAdapter.java.
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.geode.management.internal.beans.ManagementAdapter.handleDiskCreation(ManagementAdapter.java:380)
> 	at org.apache.geode.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:122)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2201)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:590)
> 	at org.apache.geode.internal.cache.DiskStoreFactoryImpl.create(DiskStoreFactoryImpl.java:143)
> {noformat}
> ManagementAdapter.handleDiskCreation throws NullPointerException on line 380 which means the thread invoking handleDiskCreation is seeing null for the field service.
> {noformat}
>     service.federate(changedMBeanName, DiskStoreMXBean.class, true);
> {noformat}
> Looks like service is SystemManagementService and it's set to a non-null value in ManagementAdaptor.handleCacheCreation:
> {noformat}
>       this.service =
>           (SystemManagementService) ManagementService.getManagementService(internalCache);
> {noformat}
> The field is not volatile and it's not protected by any synchronization:
> {noformat}
>   /** Internal ManagementService Instance **/
>   private SystemManagementService service;
> {noformat}
> Lots of other fields in ManagementAdaptor also appear to NOT be thread-safe. Looks like ManagementAdaptor concurrency in general needs to be fixed up to fix this bug.



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