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