hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cuijianwei (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-7685) Closing socket connection can't be remove from SecureClient
Date Sun, 27 Jan 2013 09:35:12 GMT

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

cuijianwei updated HBASE-7685:
------------------------------

    Description: 
We found many IOExceptions naming "Call # not added as the connection # is closing" when using
SecureClient to access hbase. From the source code of SecureClient, we found there may be
bug in close() method of SecureClient. The following is the current logic in close() method
of SecureClient:
/**********close logic in SecureClient*************/
      // release the resources
      // first thing to do;take the connection out of the connection list
      synchronized (connections) {
        if (connections.get(remoteId) == this) {
          connections.remove(remoteId);
        }
      }
However, connections are managed by PoolMap; therefore, if more than one connection are
created for the same remoteId, the 'if condition' may not be satisfied because the default
PoolType is RoundRobin. This could be cause a closing state connection can't be removed from
connections, making new calls which use such connections will always throws IOException naming
"connection is closing".
We can use logic from close() method of HBaseClient to resolve the problem:
/**********close logic in HBaseClient*************/
      // release the resources
      // first thing to do;take the connection out of the connection list
      synchronized (connections) {
        connections.remove(remoteId, this);
      }

  was:
We found many IOExceptions naming "Call # not added as the connection # is closing" when using
SecureClient to access hbase. From the source code of SecureClient, we found there may be
bug in close() method of SecureClient. The following is the current logic in close() method
of SecureClient:
/**********close logic in SecureClient*************/
      // release the resources
      // first thing to do;take the connection out of the connection list
      synchronized (connections) {
        if (connections.get(remoteId) == this) {
          connections.remove(remoteId);
        }
      }
/**********close logic in SecureClient*************/
However, connections are managed by PoolMap; therefore, if more than one connection are
created for the same remoteId, the 'if condition' may not be satisfied because the default
PoolType is RoundRobin. This could be cause a closing state connection can't be removed from
connections, making new calls which use such connections will always throws IOException naming
"connection is closing".
We can use logic from close() method of HBaseClient to resolve the problem:
/**********close logic in HBaseClient*************/
      // release the resources
      // first thing to do;take the connection out of the connection list
      synchronized (connections) {
        connections.remove(remoteId, this);
      }
/**********close logic in HBaseClient*************/

    
> Closing socket connection can't be remove from SecureClient
> -----------------------------------------------------------
>
>                 Key: HBASE-7685
>                 URL: https://issues.apache.org/jira/browse/HBASE-7685
>             Project: HBase
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.94.3
>            Reporter: cuijianwei
>         Attachments: closing_socket_connection_not_removed_in_secure_client.diff
>
>
> We found many IOExceptions naming "Call # not added as the connection # is closing" when
using SecureClient to access hbase. From the source code of SecureClient, we found there may
be bug in close() method of SecureClient. The following is the current logic in close() method
of SecureClient:
> /**********close logic in SecureClient*************/
>       // release the resources
>       // first thing to do;take the connection out of the connection list
>       synchronized (connections) {
>         if (connections.get(remoteId) == this) {
>           connections.remove(remoteId);
>         }
>       }
> However, connections are managed by PoolMap; therefore, if more than one connection
are created for the same remoteId, the 'if condition' may not be satisfied because the default
PoolType is RoundRobin. This could be cause a closing state connection can't be removed from
connections, making new calls which use such connections will always throws IOException naming
"connection is closing".
> We can use logic from close() method of HBaseClient to resolve the problem:
> /**********close logic in HBaseClient*************/
>       // release the resources
>       // first thing to do;take the connection out of the connection list
>       synchronized (connections) {
>         connections.remove(remoteId, this);
>       }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message