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

IncludeCacheManager can not perfom parallel includes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.0
    • None
    • - Components: Sitemap
    • None
    • Patch available

    Description

      Since we migrated from cocoon 2.1 to 2.2 a generator that merges multiple sources from other cocoon pipelines into one (similar to the aggregator) is not working anymore.

      We also posted our problem to the mailing list, got little feedback but it brought us on the right way...
      see also: http://www.mail-archive.com/users@cocoon.apache.org/msg42173.html

      I found out that it's a problem with the DefaultIncludeCacheManager, that can not do parallel inclusion of cocoon-pipelines anymore. I checked several classes where inclusion is used. In the aggregator parallel inclusion is not an option anymore, in CIncludeTransformer the IncludeCacheManager is used, but it can't do parallel inclusion. In the new IncludeTransfomer parallel inclusion is supported, but it does not use caching as it does not use the IncludeCacheManager...

      But we needed caching AND parallel processing, so I tried to find out what's broken in the DefaultIncludeCacheManager:
      and it seems that the ThreadLocal variables are not initialized for the child threads that do the inclusion. Neither the spring context nor the old environment stuff was initialized. And all the source resolving was done outside the child thread and that way using the wrong thread context.

      We were able to fix that issue by small changes to DefaultIncludeCacheManager and IncludeCacheManagerSession. It would be great if somebody could apply this patch so we don'T have to patch every cocoon version again and again...

      Attachments

        1. cocoon-trunk.patch
          8 kB
          imran pariyani
        2. multi-thread-simple-28.09.2008.patch
          16 kB
          Grzegorz Kossakowski
        3. ParallelInclusionProblem-cocoon_TRUNK.patch
          8 kB
          Christoph Gaffga
        4. test-block.zip
          162 kB
          imran pariyani
        5. test-block.zip
          161 kB
          imran pariyani
        6. test-webapp.zip
          34 kB
          imran pariyani
        7. test-webapp.zip
          36 kB
          imran pariyani

        Activity

          People

            Unassigned Unassigned
            cgaffga@triplemind.com Christoph Gaffga
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: