cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r651157 - in /cocoon/trunk/core: cocoon-core/src/main/resources/META-INF/cocoon/avalon/ cocoon-pipeline/cocoon-pipeline-impl/src/changes/ cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/
Date Thu, 24 Apr 2008 05:24:02 GMT
Author: joerg
Date: Wed Apr 23 22:24:00 2008
New Revision: 651157

URL: http://svn.apache.org/viewvc?rev=651157&view=rev
Log:
COCOON-2168: Set the default output buffer size of the pipeline to 1,048,576 (1 MB) rather
than -1 (complete buffering) to avoid potential OutOfMemoryErrors on too large output.

Modified:
    cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/avalon/cocoon-core-sitemapcomponents.xconf
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/changes/changes.xml
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/avalon/cocoon-core-sitemapcomponents.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/avalon/cocoon-core-sitemapcomponents.xconf?rev=651157&r1=651156&r2=651157&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/avalon/cocoon-core-sitemapcomponents.xconf
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/avalon/cocoon-core-sitemapcomponents.xconf
Wed Apr 23 22:24:00 2008
@@ -325,26 +325,28 @@
   <map:pipes default="caching">
     <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline">
       <!--+
-          | If not specified, the value of the outputBufferSize parameter is -1.
-          | This will cause Cocoon to buffer all output until processing has finished
-          | before sending it to the client. This has the advantage that in case
-          | an error occurs during the processing of the SAX-pipeline, Cocoon is still
-          | able to reset the response and send an error page instead. Otherwise the
-          | error page will be appended to the output already send to the client.
-          | If you are generating larger pages, it might be benificial to enable
-          | this parameter, so that output is gradually send to the client as it
-          | is being generated.
+          | Configures the size of the output buffer, i.e. the size of the output before
it is
+          | (partly) send to the client. In case an error occurs during the processing of
the
+          | SAX-pipeline, Cocoon is able to reset the response and send an error page instead.
+          | If the buffer size is too small the response can not be reset completely and
the error
+          | page will be appended to the output already send to the client.
+          |
+          | If not specified, the value of the outputBufferSize parameter is 1048576 (1 MB).
+          | Setting it to -1 causes Cocoon to buffer all output until processing has finished
+          | before sending it to client, but might result potentially in OutOfMemoryErrors
on too
+          | large outputs.
+          |
           | For more granularity, you can also supply this parameter to
           | individual map:pipeline elements (using map:parameter syntax).
           +-->
-      <!-- parameter name="outputBufferSize" value="8192"/ -->
+      <!-- parameter name="outputBufferSize" value="1048576"/ -->
     </map:pipe>
     <map:pipe name="caching-point" src="org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline">
       <parameter name="autoCachingPoint" value="On"/>
-      <!-- parameter name="outputBufferSize" value="8192"/ -->
+      <!-- parameter name="outputBufferSize" value="1048576"/ -->
     </map:pipe>
     <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
-      <!-- parameter name="outputBufferSize" value="8192"/ -->
+      <!-- parameter name="outputBufferSize" value="1048576"/ -->
     </map:pipe>
     <!--+
         | This pipeline implementation caches the complete content for a defined
@@ -352,6 +354,7 @@
         +-->
     <map:pipe name="expires" src="org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline">
       <parameter name="cache-expires" value="180"/> <!-- Expires in secondes -->
+      <!-- parameter name="outputBufferSize" value="1048576"/ -->
     </map:pipe>
   </map:pipes>
   

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/changes/changes.xml?rev=651157&r1=651156&r2=651157&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/changes/changes.xml (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/changes/changes.xml Wed Apr
23 22:24:00 2008
@@ -24,6 +24,12 @@
   -->
 <document>
   <body>
+    <release version="1.0.1" date="TBA" description="unreleased">
+      <action dev="joerg" type="update" fixes-bug="COCOON-2168">
+        Set the default output buffer size of the pipeline to 1,048,576 (1 MB) rather than
-1 (complete buffering) to
+        avoid potential OutOfMemoryErrors on too large output.
+      </action>
+    </release>
     <release version="1.0.0" date="TBA" description="released">
       <action dev="vgritsenko" type="fix" fixes-bug="COCOON-1985">
         Use Spring's current request attributes as a pipeline lock object

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java?rev=651157&r1=651156&r2=651157&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
(original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
Wed Apr 23 22:24:00 2008
@@ -67,6 +67,8 @@
                                                  implements ProcessingPipeline, Parameterizable,
                                                             Recyclable, Serviceable {
 
+    private static final int DEFAULT_OUTPUT_BUFFER_SIZE = 1024 * 1024; // 1MB
+    
     // Generator stuff
     protected Generator generator;
     protected Parameters generatorParam;
@@ -155,7 +157,8 @@
         if (expiresValue != null) {
             this.configuredExpires = parseExpires(expiresValue);
         }
-        this.configuredOutputBufferSize = params.getParameterAsInteger("outputBufferSize",
-1);
+        this.configuredOutputBufferSize = 
+            params.getParameterAsInteger("outputBufferSize", DEFAULT_OUTPUT_BUFFER_SIZE);
     }
 
     /**
@@ -169,8 +172,8 @@
         } else {
             this.expires = this.configuredExpires;
         }
-        this.outputBufferSize = params.getParameterAsInteger("outputBufferSize",
-                                                              this.configuredOutputBufferSize);
+        this.outputBufferSize = 
+            params.getParameterAsInteger("outputBufferSize", this.configuredOutputBufferSize);
     }
 
     /**



Mime
View raw message