portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy Watler (JIRA)" <jetspeed-...@portals.apache.org>
Subject [jira] Commented: (JS2-995) NPE in ProfilerValve under desktop mode
Date Fri, 08 May 2009 19:33:45 GMT

    [ https://issues.apache.org/jira/browse/JS2-995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707486#action_12707486
] 

Randy Watler commented on JS2-995:
----------------------------------

The profiler valve should not be attaching/detaching portal site session state in the middle
of a session unless there is some discontinuity that invalidates it. The commit here, 772985,
is not poor in itself, but might not be addressing the root of the issue. I would prefer to
continue resetting the internal state of the portal site component on session state change
if possible.

Am investigating why the session is being reset on pipeline change in the profiler valve.
This forcing the problem since the desktop configuration uses multiple pipelines simultaneously...
something the profiler valve is not properly designed for. Am also looking at why the desktop
ajax pipeline includes the profiler valve since this is a major contributor to the multiple
pipeline concurrency.

Here is the related background information from Woonsan on the race conditions in profiler
valve:

> In the ProfilerValveImpl, there are the following lines:
>
> #209~216:
>                PortalSiteSessionContext sessionContext =
> (PortalSiteSessionContext)request.getSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
>                String pipeline = request.getPipeline().getName();
>                if ((sessionContext == null) ||
> !sessionContext.isValid() || hasPipelineChanged(pipeline,
> sessionContext.getPipeline()))
>                {
>                    sessionContext = portalSite.newSessionContext();
>                    sessionContext.setPipeline(pipeline);
>
> request.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY,
> sessionContext);
>                }
> #228:
>                PortalSiteRequestContext requestContext =
> sessionContext.newRequestContext(locators, requestFallback,
> useHistory);
> #244:
>                request.setPage(new
> ContentPageImpl(requestContext.getManagedPage()));
>
>
> Here's an error scenario:
>  - There are two simultaneous requests from one browser instance
> (which requests will share a session.)
>  - One thread (T1) for one request is running just before #244.
>  - Another thread (T2) for another request is running just before #216.
>    Because T2 invokes session.setAttribute(), which will result
> valueUnbound() event for the previously stored session object.
>    The event will invoke valueUnbound() method of sessionContext
> which is being used by T1.
>  - When T1 runs #244, then it will meet NPE.
>    requestContext.getManagedPage() -->
> sessionContext.getManagedPage() --> sessionContext.getSiteView()
>    However, the profileLocator has gone! Because valueUnbound()
> method cleared it.
>
 

> NPE in ProfilerValve under desktop mode
> ---------------------------------------
>
>                 Key: JS2-995
>                 URL: https://issues.apache.org/jira/browse/JS2-995
>             Project: Jetspeed 2
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Woonsan Ko
>            Assignee: Randy Watler
>             Fix For: 2.2.0
>
>
> Under desktop mode, sometimes, the following exceptions are logged and the portlet content
is not displayed:
> 2009-05-07 19:44:19,594 [http-8080-1] ERROR
> org.apache.jetspeed.profiler.impl.ProfilerValveImpl - Exception in
> request pipeline: null
> java.lang.NullPointerException
>        at org.apache.jetspeed.om.page.ContentPageImpl.getId(ContentPageImpl.java:469)
>        at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.getPageActionAccess(ProfilerValveImpl.java:322)
>        at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerValveImpl.java:247)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
>        at org.apache.jetspeed.localization.impl.LocalizationValveImpl.invoke(LocalizationValveImpl.java:170)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
>        at org.apache.jetspeed.security.impl.AbstractSecurityValve$1.run(AbstractSecurityValve.java:138)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at javax.security.auth.Subject.doAsPrivileged(Subject.java:454)
>        at org.apache.jetspeed.security.JSSubject.doAsPrivileged(JSSubject.java:179)
>        at org.apache.jetspeed.security.impl.AbstractSecurityValve.invoke(AbstractSecurityValve.java:132)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
>        at org.apache.jetspeed.capabilities.impl.CapabilityValveImpl.invoke(CapabilityValveImpl.java:127)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
>        at org.apache.jetspeed.container.url.impl.PortalURLValveImpl.invoke(PortalURLValveImpl.java:67)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
>        at org.apache.jetspeed.pipeline.JetspeedPipeline.invoke(JetspeedPipeline.java:146)
>        at org.apache.jetspeed.engine.JetspeedEngine.service(JetspeedEngine.java:225)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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