You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "nabarun (JIRA)" <ji...@apache.org> on 2018/10/03 21:38:26 UTC

[jira] [Closed] (GEODE-5333) Failed connection objects may be retained indefinitely - can lead to OutOfMemoryError

     [ https://issues.apache.org/jira/browse/GEODE-5333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nabarun closed GEODE-5333.
--------------------------

> Failed connection objects may be retained indefinitely - can lead to OutOfMemoryError 
> --------------------------------------------------------------------------------------
>
>                 Key: GEODE-5333
>                 URL: https://issues.apache.org/jira/browse/GEODE-5333
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.7.0
>            Reporter: Kenneth Howe
>            Assignee: Kenneth Howe
>            Priority: Major
>              Labels: pull-request-available, regression
>             Fix For: 1.7.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> After refactoring of {{ConnectionFactoryImpl}} and {{ConnectionConnector}} (GEODE-5261), connections that fail during connect due to an execption (for example, {{GemfireSecurityException}}) are not destroyed ({{connection.destroy()}}).
> Prior to refactoring, the {{connect()}} was performed in a try/catch/finally in {{ConnectionFactoryImpl.createClientToServerConnection()}}
> {code:java}
>   public Connection createClientToServerConnection(ServerLocation location, boolean forQueue)
>       throws GemFireSecurityException {
>     ConnectionImpl connection = new ConnectionImpl(this.ds, this.cancelCriterion);
> ...
>     try {
>       ClientSideHandshake connHandShake = new ClientSideHandshakeImpl(handshake);
>       connection.connect(endpointManager, location, connHandShake, socketBufferSize,
>           handshakeTimeout, readTimeout, getCommMode(forQueue), this.gatewaySender,
>           this.socketCreator);
> ...
>     } catch (... e) {
>       throw e;
> ...
>     } finally {
>       if (!initialized) {
>         connection.destroy();
>         failureTracker.addFailure();
>         connection = null;
>       }
>     }
> {code}
> After the refactoring, the connect is performed in {{ConnectionConnector.connectClientToServer}}. If {{connect()}} throws an exception back to the {{ConnectionFactoryImpl}}, the connection object in {{ConnectionConnector}} isn't destroyed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)