You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/09/07 13:17:00 UTC

[jira] [Commented] (GEODE-10337) SocketCreatorFactory does not null out instance static

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

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

Commit 596a601d199ed810caf06cbc0bfc58ae3581f691 in geode's branch refs/heads/develop from Mario Ivanac
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=596a601d19 ]

GEODE-10337: add use of SocketCreatorFactory.close() (#7842)

* GEODE-10337: add use of SocketCreatorFactory.close()

* GEODE-10337: added UT

> SocketCreatorFactory does not null out instance static
> ------------------------------------------------------
>
>                 Key: GEODE-10337
>                 URL: https://issues.apache.org/jira/browse/GEODE-10337
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Darrel Schneider
>            Assignee: Mario Ivanac
>            Priority: Major
>              Labels: blocks-1.16.0, pull-request-available
>
> The SocketCreatorFactory has a static "instance" field that keeps the singleton factory. The factory has a reference in "distributionConfig" that ends up keeping the InternalDistributedSystem alive after disconnect.
> It also has a static close method but the product never calls it.
> To fix this leak do the following:
> On InternalDistributedSystem.disconnect add to the end of it:
> {code:java}
>           if (!attemptingToReconnect) {
>             SocketCreatorFactory.close();
>           }
> {code}
> Also I think it would be good to change SocketCreatorFactory.getInstance to null out the static when close it called like so:
> {code:java}
>   private static synchronized SocketCreatorFactory getInstance(boolean closing) {
>     SocketCreatorFactory result = instance;
>     if (result == null && !closing) {
>       result = new SocketCreatorFactory();
>       instance = result;
>     } else if (result != null && closing) {
>       instance = null;
>     }
>     return result;
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)