[
https://issues.apache.org/jira/browse/HTTPCLIENT-1280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13533992#comment-13533992
]
Joe Campbell commented on HTTPCLIENT-1280:
------------------------------------------
I think the answer to that is "It Depends"... a back end exception during a
re-validate, or during a "stale while re-validate" isn't a cache miss which I
think means that a back end exception might want to be caught and not exposed
to the caller - but SHOULD be logged or noted somewhere so that there is
evidence that something is going wrong. In other words, it is possible for the
behavior of this to want to change based on what we originally requested. In
the event that I don't have ANY cache entry - I do think that the back end
error should be reflected out to the caller.
> CachingExec catches SocketTimeoutException silently and closes the backend
> InputStream
> --------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1280
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1280
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: Cache
> Affects Versions: 4.2.2, 4.2.3, Snapshot
> Reporter: Francois-Xavier Bonnet
> Attachments: HTTP-1280.txt
>
>
> 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)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]