[ https://issues.apache.org/jira/browse/GEODE-9307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17360219#comment-17360219 ]
ASF subversion and git services commented on GEODE-9307: -------------------------------------------------------- Commit c4b5b1b7b8e0fcfeb24f319eb0d2234a328975d8 in geode's branch refs/heads/support/1.12 from Nabarun Nag [ https://gitbox.apache.org/repos/asf?p=geode.git;h=c4b5b1b ] GEODE-9307: Removed MembershipListener after force disconnect (#6515) (#6578) (cherry picked from commit 2bc4bd93a6c24ea32c3a44c502fcb20c0a255cb4) Co-authored-by: Barry Oglesby <bogle...@users.noreply.github.com> > 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 > Assignee: Barrett Oglesby > Priority: Major > Labels: pull-request-available > > 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)