You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Sai Boorlagadda (JIRA)" <ji...@apache.org> on 2018/05/24 18:25:00 UTC

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

Sai Boorlagadda created GEODE-5252:
--------------------------------------

             Summary: 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


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)