Hi HongShig,

I believe we cannot guarantee the worker thread would be correctly stopped even 
if the worker is to be interrupted by calling "worker.interrupt();" statement.
However, if a portlet is timeout during working with more IO related things 
such as waiting a late response from a server or waiting database query result 
(not just like System.out.println()), then the waiting can be more easily 
interrupted as expected in most cases.

Regards,

Woonsan


--- On Thu, 8/14/08, charyshs신홍식 <[EMAIL PROTECTED]> wrote:

> From: charyshs신홍식 <[EMAIL PROTECTED]>
> Subject: It seems that portlet timeout feature does not work correctly in 
> parallel mode.
> To: [email protected]
> Date: Thursday, August 14, 2008, 11:21 AM
> Hi, all
> 
> I am using jetspeed 2.1.3.
> 
> As far as I understand, portal engine running in parallel
> mode with portlet
> timeout configuration guarantees to respond in timeout by
> excluding portlets
> which does not respond in timeout.
> 
> But when I tested this situation, the portal page was not
> displayed after
> timeout, the portlets are still running after timeout.
> It looks that the interrupt signal sent by monitor thread
> does not caught by
> work thread. Refer to source code ? and ?.
> 
> [org.apache.jetspeed.aggregator.impl.WorkerMonitorImpl.java]
> ...
> 
> public void killJob(WorkerImpl worker, RenderingJob job) {
>     try {
>   if (log.isWarnEnabled()) {
>       PortletWindow window = job.getWindow();
>       ObjectID windowId = (null != window ? window.getId()
> : null);
>       log.warn("Portlet Rendering job to be
> interrupted by timeout (" +
> job.getTimeout() + "ms): " + windowId);
>   }
>   PortletContent content = job.getPortletContent();
> 
>   synchronized (content)
>   {
>       if (!content.isComplete()) {
>     worker.interrupt();
>     content.wait();
>       }
>   }
>  } catch (Exception e) {
>   log.error("Exceptiong during job killing.", e);
>  }
> }
> 
> 
> ...
> 
> 
> 
> My portal configuration is as follows.
> 
> 
> [jetspee/WEB-INF/assembly/aggregation.xml]
> ...
>  <bean
> id="org.apache.jetspeed.aggregator.PortletTrackingManager"
> class="org.apache.jetspeed.aggregator.impl.PortletTrackingManagerImpl">
> 
>         <constructor-arg index='0'>
>            <ref
> bean="PortletWindowAccessor"/>
>       </constructor-arg>
>        <!-- Default portlet timeout in milliseconds:
>         Zero means no portlet timeout option by default.
>         -->
>         <constructor-arg index='1'>
>             <value>3000</value>
>         </constructor-arg>
>         <!--  Out of service limit, if a portlet entity
> times out past its
> limit (or default limit) n consecutive times, it is taken
> out of service -->
>        <constructor-arg index="2">
>            <value>3</value>
>        </constructor-arg>
>  </bean>
> 
> ...
> <!-- The default Worker Monitor -->
>  <bean
> id="org.apache.jetspeed.aggregator.WorkerMonitor"
>  
> class="org.apache.jetspeed.aggregator.impl.WorkerMonitorImpl"
>   init-method="start" 
> destroy-method="stop" >
>  <constructor-arg index="0">
>      <!-- Minimum number of workers to create -->
>      <value>5</value>
>  </constructor-arg>
>  <constructor-arg index="1">
>      <!-- Maximum number of workers to create -->
>      <value>50</value>
>  </constructor-arg>
>  <constructor-arg index="2">
>      <!-- Spare number of workers to create -->
>      <value>3</value>
>  </constructor-arg>
>  <constructor-arg index="3">
>      <!-- Maximum number of jobs processed by a worker
> before being released
> -->
>      <value>3</value>
>  </constructor-arg>
> </bean>
> 
> 
> 
> 
> [jetspee/WEB-INF/assembly/pipelines.xml]
> ...
> <bean id="aggregatorValve"
>        
> class="org.apache.jetspeed.aggregator.AggregatorValve"
>         init-method="initialize"
>   >
>    <constructor-arg>
>        <ref
> bean="org.apache.jetspeed.aggregator.AsyncPageAggregator"/>
>    </constructor-arg>
> </bean>
> ...
> 
> 
> 
> [portlet.xml]
> ...
> <portlet id="TestPortlet">
>     <description>TestPortlet</description>
>     <description
> xml:lang="ko">TestPortlet</description>
>     <portlet-name>TestPortlet</portlet-name>
>     <display-name>TestPortlet</display-name>
>     <display-name
> xml:lang="ko">TestPortlet</display-name>
> 
> <portlet-class>org.apache.portals.bridges.common.GenericServletPortlet</portlet-class>
>     <init-param>
>       <name>ViewPage</name>
>       <value>/WEB-INF/view/delay.jsp</value>
>     </init-param>
>     <expiration-cache>0</expiration-cache>
>     <supports>
>       <mime-type>text/html</mime-type>
>       <portlet-mode>VIEW</portlet-mode>
>     </supports>
>     <supported-locale>en</supported-locale>
>     <supported-locale>ko</supported-locale>
>     <portlet-info>
>       <title>TestPortlet</title>
>       <short-title>TestPortlet</short-title>
>       <keywords>TestPortlet</keywords>
>     </portlet-info>
>   </portlet>
> ...
> 
> 
> [portlet's view page : /WEB-INF/view/delay.jsp]
> 
> <[EMAIL PROTECTED]
> contentType="text/html;charset=utf-8"%>
> 
> <%
> for(int i = 0 ; i < 2000000000; i++)
> {
>  System.out.println("Number : " + i);
> }
> 
> out.print("hello");
> %>
> 
> 
> Can anyone please help me why portlet timeout feature does
> not work
> correctly in parallel mode.
> 
> 
> 
> Thanks in advance
> 
> 
> Regards
> 
> HongShig Shin





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

Reply via email to