[ 
https://issues.apache.org/jira/browse/GEODE-9307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17352695#comment-17352695
 ] 

ASF subversion and git services commented on GEODE-9307:
--------------------------------------------------------

Commit 2bc4bd93a6c24ea32c3a44c502fcb20c0a255cb4 in geode's branch 
refs/heads/develop from Barry Oglesby
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=2bc4bd9 ]

GEODE-9307: Removed MembershipListener after force disconnect (#6515)



> 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)

Reply via email to