Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-2307

When interrupted, the ResourceReader may store incomplete data in the cache

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.11
    • Fix Version/s: 2.1.12
    • Component/s: * Cocoon Core
    • Labels:
      None
    • Other Info:
      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 ?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cedric Cédric Damioli
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: