portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r590630 - in /portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl: AsyncPageAggregatorImpl.java RenderingJobImpl.java
Date Wed, 31 Oct 2007 11:54:28 GMT
Author: woonsan
Date: Wed Oct 31 04:54:27 2007
New Revision: 590630

URL: http://svn.apache.org/viewvc?rev=590630&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/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java?rev=590630&r1=590629&r2=590630&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
Wed Oct 31 04:54:27 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/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java?rev=590630&r1=590629&r2=590630&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
Wed Oct 31 04:54:27 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: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message