HBase
  1. HBase
  2. HBASE-4105

Stargate does not support Content-Type: application/json and Content-Encoding: gzip in parallel

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.90.1
    • Fix Version/s: 0.90.4, 0.94.0
    • Component/s: REST
    • Labels:
    • Environment:

      Server: jetty/6.1.26
      REST: 0.0.2
      OS: Linux 2.6.32-bpo.5-amd64 amd64
      Jersey: 1.4
      JVM: Sun Microsystems Inc. 1.6.0_22-17.1-b03

      Description

      When:
      curl -H "Accept: application/json" http://localhost:3000/version -v

      Response is:

      About to connect() to localhost port 3000 (#0)
      Trying 127.0.0.1... connected
      Connected to localhost (127.0.0.1) port 3000 (#0)
      > GET /version HTTP/1.1
      > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
      > Host: localhost:3000
      > Accept: application/json
      >
      < HTTP/1.1 200 OK
      < Cache-Control: no-cache
      < Content-Type: application/json
      < Transfer-Encoding: chunked
      <
      Connection #0 to host localhost left intact
      Closing connection #0

      {"Server":"jetty/6.1.26","REST":"0.0.2","OS":"Linux 2.6.32-bpo.5-amd64 amd64","Jersey":"1.4","JVM":"Sun Microsystems Inc. 1.6.0_22-17.1-b03"}

      but with compression:
      curl -H "Accept: application/json" http://localhost:3000/version -v --compressed

      Reponse is:

      About to connect() to localhost port 3000 (#0)
      Trying 127.0.0.1 ... connected
      Connected to localhost (127.0.0.1) port 3000 (#0)
      > GET /version HTTP/1.1
      > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
      > Host: localhost:3000
      > Accept-Encoding: deflate, gzip
      > Accept: application/json
      >
      < HTTP/1.1 200 OK
      < Cache-Control: no-cache
      < Content-Type: application/json
      < Content-Encoding: gzip
      < Transfer-Encoding: chunked
      <
      Connection #0 to host localhost left intact
      Closing connection #0

      and the stargate server throws the following exception:

      11/07/14 11:21:44 ERROR mortbay.log: /version
      java.lang.ClassCastException: org.mortbay.jetty.HttpConnection$Output cannot be cast to org.apache.hadoop.hbase.rest.filter.GZIPResponseStream
      at org.apache.hadoop.hbase.rest.filter.GzipFilter.doFilter(GzipFilter.java:54)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      This is not reproduceable with content type text/plain and gzip.

      This is somehow related to https://issues.apache.org/jira/browse/HBASE-3275

      1. HBASE-4105.patch
        2 kB
        Andrew Purtell

        Activity

        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #2190 (See https://builds.apache.org/job/HBase-TRUNK/2190/)
        HBASE-4105 HBASE-4015-Making the timeout monitor less racy; third attempt

        stack :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignCallable.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/UnAssignCallable.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java
        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #2190 (See https://builds.apache.org/job/HBase-TRUNK/2190/ ) HBASE-4105 HBASE-4015 -Making the timeout monitor less racy; third attempt stack : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignCallable.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/UnAssignCallable.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java /hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #2047 (See https://builds.apache.org/job/HBase-TRUNK/2047/)
        HBASE-4105 Stargate does not support json and gzip in parallel

        apurtell :
        Files :

        • /hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/filter/GZIPResponseWrapper.java
        • /hbase/trunk/CHANGES.txt
        • /hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #2047 (See https://builds.apache.org/job/HBase-TRUNK/2047/ ) HBASE-4105 Stargate does not support json and gzip in parallel apurtell : Files : /hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/filter/GZIPResponseWrapper.java /hbase/trunk/CHANGES.txt /hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestGzipFilter.java
        Hide
        Andrew Purtell added a comment -

        Added a test case for checking that the gzip filter does not interfere with expected return codes.

        Show
        Andrew Purtell added a comment - Added a test case for checking that the gzip filter does not interfere with expected return codes.
        Hide
        Andrew Purtell added a comment -

        Committed to trunk and 0.90 branch. All tests pass locally.

        Show
        Andrew Purtell added a comment - Committed to trunk and 0.90 branch. All tests pass locally.
        Hide
        stack added a comment -

        +1

        Commit it I'd say. I"ve tagged RC0. I think its going to go down soon going by my testing.

        Show
        stack added a comment - +1 Commit it I'd say. I"ve tagged RC0. I think its going to go down soon going by my testing.
        Hide
        Andrew Purtell added a comment -

        Attached patch for this issue. Also fixes a problem reported on the user list where response codes other than 200 are not being set if the gzip filter is active.

        Show
        Andrew Purtell added a comment - Attached patch for this issue. Also fixes a problem reported on the user list where response codes other than 200 are not being set if the gzip filter is active.
        Hide
        stack added a comment -

        What you reckon Andrew?

        Show
        stack added a comment - What you reckon Andrew?

          People

          • Assignee:
            Andrew Purtell
            Reporter:
            Jean-Pierre Koenig
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development