Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7685

Closing socket connection can't be removed from SecureClient

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.3
    • Fix Version/s: 0.94.5
    • Component/s: security
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      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:

            // 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:

            // release the resources
            // first thing to do;take the connection out of the connection list
            synchronized (connections) {
              connections.remove(remoteId, this);
            }
      

        Attachments

        1. closing_socket_connection_not_removed_in_secure_client.diff
          0.7 kB
          Jianwei Cui
        2. HBASE-7685-0.94.txt
          0.7 kB
          Jianwei Cui

          Activity

            People

            • Assignee:
              cuijianwei Jianwei Cui
              Reporter:
              cuijianwei Jianwei Cui
            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: