Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.11
-
None
-
Patch available
Description
the code of the generate() method of the ResourceReader is basically :
{code}
public void generate() throws IOException, ProcessingException {
try {
// process stream
} catch (IOException e) {
getLogger().debug("Received an IOException, assuming client severed connection on purpose");
}
{code}
the code of the processReader() method in AbstractCachingProcessingPipeline is basically :
{code}
protected boolean processReader(Environment environment){
try {
...
reader.generate();
cache.store(pcKey, res);
...
} catch (Exception e) {
handleException(e);
}
{code}
If the client abort the connection, a SocketException (eventually wrapped by Tomcat in a ClientAbortException) is thrown, catched in the ResourceReader and not rethrown. The method finish normally and truncated data is then stored in the cache.
Next requests lookup the cache and return truncated data.
I suggest to simply rethrow the IOException in the catch block, so that the exception handling mechanism of the AbstractCachingProcessingPipeline may be executed
WDYT ?
{code}
public void generate() throws IOException, ProcessingException {
try {
// process stream
} catch (IOException e) {
getLogger().debug("Received an IOException, assuming client severed connection on purpose");
}
{code}
the code of the processReader() method in AbstractCachingProcessingPipeline is basically :
{code}
protected boolean processReader(Environment environment){
try {
...
reader.generate();
cache.store(pcKey, res);
...
} catch (Exception e) {
handleException(e);
}
{code}
If the client abort the connection, a SocketException (eventually wrapped by Tomcat in a ClientAbortException) is thrown, catched in the ResourceReader and not rethrown. The method finish normally and truncated data is then stored in the cache.
Next requests lookup the cache and return truncated data.
I suggest to simply rethrow the IOException in the catch block, so that the exception handling mechanism of the AbstractCachingProcessingPipeline may be executed
WDYT ?