You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2008/04/24 06:57:12 UTC

svn commit: r651155 - in /cocoon/branches/BRANCH_2_1_X: src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java src/webapp/sitemap.xmap status.xml

Author: joerg
Date: Wed Apr 23 21:57:11 2008
New Revision: 651155

URL: http://svn.apache.org/viewvc?rev=651155&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/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
    cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java?rev=651155&r1=651154&r2=651155&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java Wed Apr 23 21:57:11 2008
@@ -64,6 +64,8 @@
         extends AbstractLogEnabled
         implements ProcessingPipeline, Parameterizable, Recyclable {
 
+    private static final int DEFAULT_OUTPUT_BUFFER_SIZE = 1024 * 1024; // 1MB
+
     // Generator stuff
     protected Generator generator;
     protected Parameters generatorParam;
@@ -156,7 +158,7 @@
         if (expiresValue != null) {
             this.configuredExpires = parseExpires(expiresValue);
         }
-        this.configuredOutputBufferSize = params.getParameterAsInteger("outputBufferSize", -1);
+        this.configuredOutputBufferSize = params.getParameterAsInteger("outputBufferSize", DEFAULT_OUTPUT_BUFFER_SIZE);
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap?rev=651155&r1=651154&r2=651155&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap Wed Apr 23 21:57:11 2008
@@ -408,28 +408,30 @@
      <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"
                pool-max="${caching-pipeline.pool-max}">
        <!--+
-           | 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"
                pool-max="${caching-point-pipeline.pool-max">
        <!-- 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"
                pool-max="${noncaching-pipeline.pool-max}">
-       <!-- parameter name="outputBufferSize" value="8192"/ -->
+       <!-- parameter name="outputBufferSize" value="1048576"/ -->
      </map:pipe>
      <!--+
          | This pipeline implementation caches the complete content for a defined
@@ -438,6 +440,7 @@
      <map:pipe name="expires" src="org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline"
                pool-max="${expires-pipeline.pool-max}">
        <parameter name="cache-expires" value="${expires-pipeline.cache-expires}"/> <!-- Expires in secondes -->
+       <!-- parameter name="outputBufferSize" value="1048576"/ -->
      </map:pipe>
    </map:pipes>
 

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?rev=651155&r1=651154&r2=651155&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Apr 23 21:57:11 2008
@@ -182,6 +182,10 @@
 
   <changes>
   <release version="2.1.12" date="TBD">
+    <action dev="JH" type="update" fixes-bug="COCOON-2168">
+      Core: 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>
     <action dev="AN" type="add">
       Core: In Cocoon 2.2 the org.apache.cocoon.environment.Session interface
       is deprecated, and the return type of getSession() changes to