cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Ask for a help with multi-thread problems (COCOON-2216)
Date Thu, 13 Nov 2008 10:07:37 GMT

Having (finally) some free time again I decided to give COCOON-2216 another try. Unfortunately,
wasn't entirely successful with my latest attempt even if there seems to be progress.

Actually, you don't need to follow my previous attempts and comments to understand what's
going on
with latest patches trying to fix this annoying bug. Current problem is that it looks like
I get
into some race conditions but I have no idea how to track them.

Little background: the problem was with the ObjectModel that was shared between child threads
leading to illegal state. The solution was to clone ObjectModel object so separate instances
used across different child threads. I decided to bind ObjectModel to Environment (as it felt
natural to do so) and to implement cloning in AbstractCocoonRunnable. Moreover, there is a
bean factory that returns an ObjectModel instance obtained from the current Environment.
Additionally, this instance is being wrapped by a proxy so we can be sure that other beans
reference correct instance of the ObjectModel.

You can find my modifications here:

If you wonder why this is uploaded to Github the answer is rather simple - I believe that
better way to share patches so they are available for online browsing along with commit messages
before they get committed to trunk. Imran provided us a test-case that nicely exhibits problems
both our implementation in Cocoon's trunk (or lack of it) and these race conditions in my
implementation. The code is available here: (referenced from

How to reproduce:
1. Download patched Cocoon sources from and compile
2. Download test-block, run it using mvn jetty:run.
3. Point your browser to http://localhost:8888/test-block/index.html
4. Check console if information about exceptions are being printed out.

I would kindly ask multi-thread-programming gurus to have a look at this problem as I feel
running out of ideas and energy...

Best regards,
Grzegorz Kossakowski

View raw message