Author: woonsan
Date: Wed Oct 31 04:53:49 2007
New Revision: 590629

URL: http://svn.apache.org/viewvc?rev=590629&view=rev
Log:
[JS2-785] Parallel Rendering on Websphere 6.1
Fixed the following problem:

Problem: Sometimes, a page request does not get response in parallel rendering 
mode. Thread dump shows that a thread is hanging on portletContent.wait() in 
AsyncPageAggregatorImpl.

My previous revision on RenderingJobImpl caused a synchronization issue. 
(http://svn.apache.org/viewvc?view=rev&revision=587106)
Before r587106, RenderingJobImpl completes portlet content, followed by logging 
statistics, and followed by notifying to AsyncPageAggregatorImpl. Meanwhile, 
AsyncPageAggregatorImpl waits for portlet content if the portlet content is not 
complete.
Before r587106, the interval between portletContent.isComplete() and 
portletContent.notifyAll() in RenderingJobImpl might be usually longer than the 
interval between portletContent.isComplete() and portletContent.wait() in 
AsyncPageAggregatorImpl.
So, this synchronization issue has been hidden so far.

Therefore, to fix this problem completely, synchronization blocks are added to 
both RenderingJobImpl and AsyncPageAggregatorImpl to keep the completion status 
of portlet content consistently.

Modified:
    
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
    
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java

Modified: 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java?rev=590629&r1=590628&r2=590629&view=diff
==============================================================================
--- 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
 (original)
+++ 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
 Wed Oct 31 04:53:49 2007
@@ -224,9 +224,9 @@
                 RenderingJob job = (RenderingJob) iter.next();
                 PortletContent portletContent = job.getPortletContent();
                 
-                if (!portletContent.isComplete()) 
+                synchronized (portletContent) 
                 {
-                    synchronized (portletContent) 
+                    if (!portletContent.isComplete()) 
                     {
                         portletContent.wait();
                     }

Modified: 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java?rev=590629&r1=590628&r2=590629&view=diff
==============================================================================
--- 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
 (original)
+++ 
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
 Wed Oct 31 04:53:49 2007
@@ -182,7 +182,7 @@
         {
             synchronized (portletContent)
             {
-               log.debug("Notifying completion of rendering job for fragment " 
+ fragment.getId());                
+               if (log.isDebugEnabled()) log.debug("Notifying completion of 
rendering job for fragment " + fragment.getId());                
                portletContent.notifyAll();
             }
         }
@@ -202,7 +202,7 @@
         PortletWindow curWindow = this.window;
         try
         {
-            log.debug("Rendering OID "+this.window.getId()+" "+ this.request 
+" "+this.response);
+            if (log.isDebugEnabled()) log.debug("Rendering OID 
"+this.window.getId()+" "+ this.request +" "+this.response);
 
             // if the current thread is worker, then store attribues in that.
             if (this.workerAttributes != null)
@@ -311,13 +311,16 @@
             }
             finally
             {
-                if (fragment.getOverriddenContent() != null)
+                synchronized (portletContent)
                 {
-                    portletContent.completeWithError();
-                }
-                else
-                {
-                    portletContent.complete();
+                    if (fragment.getOverriddenContent() != null)
+                    {
+                        portletContent.completeWithError();
+                    }
+                    else
+                    {
+                        portletContent.complete();
+                    }
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to