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

ASF GitHub Bot commented on GEODE-3286:
---------------------------------------

Github user WireBaron commented on a diff in the pull request:

    https://github.com/apache/geode/pull/657#discussion_r129961225
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java ---
    @@ -279,26 +280,29 @@ protected void acceptConnection(Socket sock) throws 
IOException, ConnectionExcep
           // in our caller.
           // no need to log error here since caller will log warning
     
    -      if (conn != null && !finishedConnecting) {
    +      if (connection != null && !finishedConnecting) {
             // we must be throwing from checkCancelInProgress so close the 
connection
    -        
closeCon(LocalizedStrings.ConnectionTable_CANCEL_AFTER_ACCEPT.toLocalizedString(),
 conn);
    -        conn = null;
    +        
closeCon(LocalizedStrings.ConnectionTable_CANCEL_AFTER_ACCEPT.toLocalizedString(),
    +            connection);
    +        connection = null;
           }
         }
     
    -    if (conn != null) {
    +    if (connection != null) {
           synchronized (this.receivers) {
    -        this.owner.stats.incReceivers();
    +        this.owner.getStats().incReceivers();
             if (this.closed) {
               
closeCon(LocalizedStrings.ConnectionTable_CONNECTION_TABLE_NO_LONGER_IN_USE
    -              .toLocalizedString(), conn);
    +              .toLocalizedString(), connection);
               return;
             }
    -        this.receivers.add(conn);
    +        if (!connection.isSocketClosed()) {
    --- End diff --
    
    Looks like there may be an issue here since the socket close is done 
asynchronously from the connection close().  I've changed the check to also 
check connection.stopped, which is set to false inside the close call, before 
the connection cleans up it's state.


> Failing to cleanup connections from ConnectionTable receiver table
> ------------------------------------------------------------------
>
>                 Key: GEODE-3286
>                 URL: https://issues.apache.org/jira/browse/GEODE-3286
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Brian Rowe
>
> Improperly handled closed connections in ConnectionTable can lead to 
> {{OutOfMemoryError}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to