Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-9307

When a server is force disconnected, its regions can still be referenced

    XMLWordPrintableJSON

    Details

      Description

      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

      try {
        getDistributionManager().removeMembershipListener(membershipListener);
      } catch (CancelException e) {
        // if distribution has stopped, above is a no-op.
      } ...
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              boglesby Barrett Oglesby
              Reporter:
              boglesby Barrett Oglesby
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: