21 Aug 14:13
[2.1] AbstractCachingProcessingPipeline and cocoon CLI
From: Thorsten Scherler <thorsten.scherler.ext <at> juntadeandalucia.es>
Subject: [2.1] AbstractCachingProcessingPipeline and cocoon CLI
Newsgroups: gmane.text.xml.cocoon.devel
Date: 2008-08-21 12:18:03 GMT
Subject: [2.1] AbstractCachingProcessingPipeline and cocoon CLI
Newsgroups: gmane.text.xml.cocoon.devel
Date: 2008-08-21 12:18:03 GMT
Hi all, still updating forrest to use cocoon-2.1.x and I found a problem in the AbstractCachingProcessingPipeline. I am not sure whether someone is using the cocoon cli ATM. Forrest is based around this component. https://issues.apache.org/jira/browse/FOR-955?focusedCommentId=12624340#action_12624340 I found that in org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline line 245 Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT); the lock is null which causes the NPE in the end. I changed it the following way: Object lock = env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT); + if (null==lock){ + lock = env.getObjectModel().get(ObjectModelHelper.REQUEST_OBJECT); + } try { and now it is working as before. Can somebody verify that it is a bug? Should I commit the patch? TIA for any feedback.(Continue reading)
Makes me wonder since HttpServletRequest is always unique as well due to
the headers, so does not violate as well the whole locking?
> You could, for example, have same effect with code:
>
> // Avoids NPE, does nothing
> if (lock == null) lock = new Object();
>
>
> To get back to the problem... The original goal of pipeline locking
> was to prevent separate external requests to start generating cached
> response for the same resource-intensive resource. In other words, if
> too external requests both (directly or through aggregation) hit '/
> slow/cached/foo' resource, only one request will trigger this
> pipeline, while another will wait for the first to complete.
>
> This logic, in turn, had to be augmented to exclude single external
> request hitting the same slow resource twice due to aggregation (and
> parallel aggregation), hence locking against top level external
> request was implemented.
>
RSS Feed