Uploaded image for project: 'Identity Gateway'
  1. Identity Gateway
  2. OPENIG-1053

Downloading large file fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0, 4.5.0, 5.0.0
    • Fix Version/s: 5.0.0
    • Component/s: CHF, Core
    • Labels:
    • Environment:
      OS : OSX 10.11.5
      container : Tomcat 8.0.23
      jdk : 1.8.0_73
    • Support Ticket IDs:
    • Sprint:
      OpenIG Sprint 90

      Description

      Using OpenIG as pure proxy

      {
          "MyCapture": "all",
          "baseURI": "http://app.example.com:8083",
          "condition": "${request.headers['test_id'][0] == 'client_handler'}",
          "handler": {
              "type": "ClientHandler"
          }
      }
      

      When I download a file (using httpie in this exammple)

      http --download http://openig.example.com:8081/my_file_to_download.zip test_id:client_handler
      

      Then I get the following error :

      a) in case the file size is greater than Integer.MAX_VALUE (whatever the JVM allocated memory) :

      01:10:17:104 | ERROR | I/O dispatcher 13 | o.f.h.a.a.AsyncHttpClient | Failed to obtain response for http://openam.example.com:8083/2500.txt
      01:10:17:105 | WARN  | I/O dispatcher 13 | clienthandler-handler | Entity content is too long: 2500000000
      org.apache.http.ContentTooLongException: Entity content is too long: 2500000000
      	at org.apache.http.nio.protocol.BasicAsyncResponseConsumer.onEntityEnclosed(BasicAsyncResponseConsumer.java:69) ~[httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.responseReceived(AbstractAsyncResponseConsumer.java:131) ~[httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.client.MainClientExec.responseReceived(MainClientExec.java:315) ~[httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseReceived(DefaultClientExchangeHandlerImpl.java:147) ~[httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.responseReceived(HttpAsyncRequestExecutor.java:282) ~[httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:257) ~[httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81) [httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39) [httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:116) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:164) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590) [httpcore-nio-4.4.1.jar:4.4.1]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_73]
      

      b) in case the file size is greater than the JVM allocated memory :

      01:10:02:703 | ERROR | I/O dispatcher 12 | o.f.h.a.a.AsyncHttpClient | Failed to obtain response for http://openam.example.com:8083/500.txt
      01:10:02:713 | WARN  | I/O dispatcher 12 | clienthandler-handler | Connection closed unexpectedly
      org.apache.http.ConnectionClosedException: Connection closed unexpectedly
      	at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.closed(HttpAsyncRequestExecutor.java:137) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.client.InternalIODispatch.onClosed(InternalIODispatch.java:71) [httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.impl.nio.client.InternalIODispatch.onClosed(InternalIODispatch.java:39) [httpasyncclient-4.1.jar:4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIODispatch.disconnected(AbstractIODispatch.java:102) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.BaseIOReactor.sessionClosed(BaseIOReactor.java:281) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processClosedSessions(AbstractIOReactor.java:442) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.hardShutdown(AbstractIOReactor.java:578) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:307) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.4.1.jar:4.4.1]
      	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590) [httpcore-nio-4.4.1.jar:4.4.1]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_73]
      

      QA-info : (to reproduce)

      python run-pybot.py -s *handlers_python.clienthandler openig
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              laurent.vaills Laurent Vaills
              Reporter:
              jcdevil Jean-Charles Deville
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: