Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1280

CachingExec catches SocketTimeoutException silently and closes the backend InputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.2, 4.2.3
    • 4.3 Alpha1
    • HttpCache
    • None

    Description

      When a SocketTimeoutException occurs, CachingExec catches and logs it, then closes the Inputstream:
      11-12 08:23:18 10010 [qtp907773188-11] WARN org.apache.http.impl.client.cache.CachingHttpClient - Unable to store entries in cache
      java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:150)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:204)
      at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:177)
      at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:201)
      at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:155)
      at org.apache.http.impl.client.cache.HeapResourceFactory.generate(HeapResourceFactory.java:54)
      at org.apache.http.impl.client.cache.SizeLimitedResponseReader.doConsume(SizeLimitedResponseReader.java:103)
      at org.apache.http.impl.client.cache.SizeLimitedResponseReader.readResponse(SizeLimitedResponseReader.java:75)
      at org.apache.http.impl.client.cache.BasicHttpCache.cacheAndReturnResponse(BasicHttpCache.java:241)
      at org.apache.http.impl.client.cache.CachingHttpClient.handleBackendResponse(CachingHttpClient.java:916)
      at org.apache.http.impl.client.cache.CachingHttpClient.callBackend(CachingHttpClient.java:729)
      at org.apache.http.impl.client.cache.CachingHttpClient.handleCacheMiss(CachingHttpClient.java:508)
      at org.apache.http.impl.client.cache.CachingHttpClient.execute(CachingHttpClient.java:436)
      at org.esigate.cache.CacheAdapter$HttpClientWrapper.execute(CacheAdapter.java:123)

      Then there is no way for the code to know that a problem occurred and if you try to read the entity you get another Exception:
      java.net.SocketException: Socket closed
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:150)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
      at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
      at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:183)
      at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:140)
      at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:121)

      Attachments

        1. HTTP-1280.txt
          4 kB
          Francois-Xavier Bonnet

        Activity

          People

            Unassigned Unassigned
            fx.bonnet Francois-Xavier Bonnet
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: