You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Esteban Gutierrez (Jira)" <ji...@apache.org> on 2019/08/26 16:45:00 UTC

[jira] [Created] (HBASE-22926) REST server should return 504 Gateway Timeout Error on scanner timeout

Esteban Gutierrez created HBASE-22926:
-----------------------------------------

             Summary: REST server should return 504 Gateway Timeout Error on scanner timeout
                 Key: HBASE-22926
                 URL: https://issues.apache.org/jira/browse/HBASE-22926
             Project: HBase
          Issue Type: Bug
          Components: REST
    Affects Versions: 2.2.0, 2.1.0, 3.0.0
            Reporter: Esteban Gutierrez
            Assignee: Esteban Gutierrez


Currently when a scanner timeout error occurs on the RS side, a client will get a RetriesExhaustedException that will make the client to fail, however from the REST server point of view that is just an IOE:

org.apache.hadoop.hbase.rest.ScannerResultGenerator#next
{code}
} else {
        Result result = null;
        try {
          result = scanner.next();
        } catch (UnknownScannerException e) {
          throw new IllegalArgumentException(e);
        } catch (TableNotEnabledException tnee) {
          throw new IllegalStateException(tnee);
        } catch (TableNotFoundException tnfe) {
          throw new IllegalArgumentException(tnfe);
        } catch (IOException e) {
          LOG.error(StringUtils.stringifyException(e));
        }
{code}

Now, with that empty result (will handle this as an HTTP 204 response back to the client:

org.apache.hadoop.hbase.rest.ScannerInstanceResource#get
{code}
...
  Cell value = null;
      try {
        value = generator.next();
      } catch (IllegalStateException e) {
...
      } catch (IllegalArgumentException e) {
...
      }
...
if (value == null) {
        if (LOG.isTraceEnabled()) {
          LOG.trace("generator exhausted");
        }
        // respond with 204 (No Content) if an empty cell set would be
        // returned
        if (count == limit) {
          return Response.noContent().build();
        }
        break;
{code}

Obviously this is wrong, since a RetriesExhaustedException is most likely due a failure in the RS side. The correct behavior should be a 504 Gateway Timeout Error.






--
This message was sent by Atlassian Jira
(v8.3.2#803003)