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

HBaseClient retries even though a DoNotRetryException was thrown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 0.94.12, 0.99.0
    • None
    • IPC/RPC
    • None
    • Phoenix

    Description

      Throwing a DoNotRetryIOException inside Writable.write(Dataoutput) method doesn't prevent HBase from retrying. Debugging the code locally, I figured that the bug lies in the way HBaseClient simply throws an IOException when it sees that a connection has been closed unexpectedly.

      Method:
      public Writable call(Writable param, InetSocketAddress addr,
      Class<? extends VersionedProtocol> protocol,
      User ticket, int rpcTimeout)

      Excerpt of code where the bug is present:
      while (!call.done) {
      if (connection.shouldCloseConnection.get())

      { throw new IOException("Unexpected closed connection"); }

      Throwing this IOException causes the ServerCallable.translateException(t) to be a no-op resulting in HBase retrying.

      From my limited view and understanding of the code, one way I could think of handling this is by looking at the closeConnection member variable of a connection to determine what kind of exception should be thrown.

      Specifically, when a connection is closed, the current code does this:

      protected synchronized void markClosed(IOException e) {
      if (shouldCloseConnection.compareAndSet(false, true))

      { closeException = e; notifyAll(); }

      }

      Within HBaseClient's call method, the code could possibly be modified to:

      while (!call.done) {
      if (connection.shouldCloseConnection.get() ) {
      if(connection.closeException instanceof DoNotRetryIOException)

      { throw closeException; } throw new IOException("Unexpected closed connection"); }

      Attachments

        1. 10185.v2.patch
          9 kB
          Nicolas Liochon
        2. 10185.v1.patch
          5 kB
          Nicolas Liochon

        Issue Links

          Activity

            People

              Unassigned Unassigned
              samarthjain Samarth Jain
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: