cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Puerto (JIRA)" <>
Subject [jira] [Commented] (COCOON-2340) XMLByteStreamCompiler in not thread-safe
Date Sat, 30 Nov 2013 14:27:36 GMT


Javier Puerto commented on COCOON-2340:

Hi Ivan,

By the error, you are using a pipeline with expires caching enabled and the problem seems
to be retrieving an XML fragment (CInclude transformer?). With this information I can't investigate
further, I've also used with others projects the expires caching in pipelines without any
concurrency issues so I recommend you to provide a small pipeline fragment where the problem
can be reproduced so we can take a look. Following the advices I've said in the previous comment,
Apache Cocoon 2.2 should not have any concurrency problems.

To found the possible cause you could use the "ab" tool (ApacheBench [1]) that comes with
the Apache HTTPD server. Then comment everything that involves with your pipeline leaving
just the generator and the serializer and start uncommenting and testing with "ab" tool with
high concurrency, this way you can isolate the problematic component or pipeline.

Good luck and salu2.


> XMLByteStreamCompiler in not thread-safe
> ----------------------------------------
>                 Key: COCOON-2340
>                 URL:
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.2
>            Reporter: Ivan Lagunov
> I'm periodically getting the following exceptions in different places:
> Caused by: java.lang.ArrayIndexOutOfBoundsException
>         at java.lang.System.arraycopy(Native Method)
>         at org.apache.cocoon.components.sax.XMLByteStreamCompiler.getSAXFragment(
>         at org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline.processXMLPipeline(
> After debugging I've found the root cause. It happens due to multi-threading when one
thread allocates newbuf array, then another thread increments bufCount in write method and
then the first thread fails on System.arraycopy invocation.
> I suggest making getSAXFragment and write methods synchronized. It should resolve the
issue. If it helps, I'll provide a patch later.

This message was sent by Atlassian JIRA

View raw message