portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r587106 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
Date Mon, 22 Oct 2007 14:21:57 GMT
Author: woonsan
Date: Mon Oct 22 07:21:57 2007
New Revision: 587106

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

With high load, an exception can occur like the following:

2007-10-21 03:46:25,902 [WorkManager.WM-Jetspeed : 86] ERROR org.apache.jetspeed.statistics.impl.PortalStatisticsImpl
- Exception
java.lang.NullPointerException
at com.ibm.ws.wswebcontainer.webapp.WebAppDispatcherContext.getUserPrincipal(WebAppDispatcherContext.java:58)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getUserPrincipal(SRTServletRequest.java:1785)
at javax.servlet.http.HttpServletRequestWrapper.getUserPrincipal(HttpServletRequestWrapper.java:218)
at org.apache.jetspeed.statistics.impl.PortalStatisticsImpl.logPortletAccess(PortalStatisticsImpl.java:166)
at org.apache.jetspeed.aggregator.impl.RenderingJobImpl.execute(RenderingJobImpl.java:316)

Problem Determination: Using statistics component should be done before invoking portletContent.complete*()
methods in parallel rendering mode. AsyncPageAggregatorImpl waits for portlets to be completed
and moves to rendering layouts, restoring the rendering mode to non-parallel. If the rendering
mode of current worker context changes before invoking statistics component, then the statistics
component cannot access request instance properly in parallel rendering mode.

Modified:
    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/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=587106&r1=587105&r2=587106&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
Mon Oct 22 07:21:57 2007
@@ -277,37 +277,47 @@
         }
         finally
         {
-            long end = System.currentTimeMillis();            
-            boolean exceededTimeout = portletTracking.exceededTimeout(end - start, window);
-            if (fragment.getOverriddenContent() != null)
-                portletContent.completeWithError();
-            else
-                portletContent.complete();
-            
-            if (isParallelMode)
+            try
             {
-                this.renderer.addTitleToHeader(curWindow, fragment,
-                                               this.request, this.response,
-                                               this.dispatcher, this.contentIsCached);
-            
-                CurrentWorkerContext.removeAllAttributes();
-            }
-            
-            if (fragment.getType().equals(ContentFragment.PORTLET))
-            {
-                if (statistics != null)
+                if (isParallelMode)
+                {
+                    this.renderer.addTitleToHeader(curWindow, fragment,
+                                                   this.request, this.response,
+                                                   this.dispatcher, this.contentIsCached);
+                
+                    CurrentWorkerContext.removeAllAttributes();
+                }
+                
+                if (fragment.getType().equals(ContentFragment.PORTLET))
                 {
-                    statistics.logPortletAccess(requestContext, fragment.getName(), PortalStatistics.HTTP_OK,
end - start);
+                    long end = System.currentTimeMillis();
+                    boolean exceededTimeout = portletTracking.exceededTimeout(end - start,
window);
+                    
+                    if (statistics != null)
+                    {
+                        statistics.logPortletAccess(requestContext, fragment.getName(), PortalStatistics.HTTP_OK,
end - start);
+                    }
+                    if (exceededTimeout)
+                    {
+                        // took too long to render
+                        log.info("Portlet Exceeded timeout: " + curWindow.getPortletEntity().getPortletDefinition().getName()
+ " for window " + curWindow.getId());
+                        portletTracking.incrementRenderTimeoutCount(curWindow);
+                    }
+                    else
+                    {
+                        portletTracking.success(curWindow);
+                    }
                 }
-                if (exceededTimeout)
+            }
+            finally
+            {
+                if (fragment.getOverriddenContent() != null)
                 {
-                    // took too long to render
-                    log.info("Portlet Exceeded timeout: " + curWindow.getPortletEntity().getPortletDefinition().getName()
+ " for window " + curWindow.getId());
-                    portletTracking.incrementRenderTimeoutCount(curWindow);
+                    portletContent.completeWithError();
                 }
                 else
                 {
-                    portletTracking.success(curWindow);
+                    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