You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Barrett Oglesby (Jira)" <ji...@apache.org> on 2021/05/25 00:04:00 UTC

[jira] [Created] (GEODE-9307) When a server is force disconnected, its regions can still be referenced

Barrett Oglesby created GEODE-9307:
--------------------------------------

             Summary: When a server is force disconnected, its regions can still be referenced
                 Key: GEODE-9307
                 URL: https://issues.apache.org/jira/browse/GEODE-9307
             Project: Geode
          Issue Type: Bug
          Components: regions
            Reporter: Barrett Oglesby


When a server is force disconnected, any of its DistributedRegions will not be GCed after they are closed. This is really only a problem if the GemFireCacheImpl is referenced in something other than the ClusterDistributionManager.cache field (in my test, I used a static field of a Function)

The GemFireCacheImpl references a ClusterDistributionManager in the final field called dm.

The DistributedRegion creates and references a DistributionAdvisor in the final field called distAdvisor. The DistributionAdvisor creates a MembershipListener and adds it to the ClusterDistributionManager's membershipListeners.

When the GemFireCacheImpl is closed due to force disconnect, its regions are also closed.

When a DistributedRegion is closed, its DistributionAdvisor is also closed.

DistributionAdvisor.close attempts to remove the MembershipListener
{noformat}
try {
  getDistributionManager().removeMembershipListener(membershipListener);
} catch (CancelException e) {
  // if distribution has stopped, above is a no-op.
} ...
{noformat}
That call fails with a CancelException, and the MembershipListener is not removed, so the ClusterDistributionManager references both the GemFireCacheImpl and the MembershipListener. The MembershipListener references the DistributionAdvisor which references the DistributedRegion.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)