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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.11
    • 2.1.12
    • * Cocoon Core
    • 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 ?

      Attachments

        1. ResourceReader.java.patch
          0.7 kB
          Cédric Damioli

        Activity

          People

            Unassigned Unassigned
            cdamioli Cédric Damioli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: