tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: [5.0] No sessions purged in Context with backgroundProcessorDelay > 0?
Date Wed, 15 Oct 2003 16:53:14 GMT
Thanks for confirming, Remy!

I'll make these changes.

Jan

Remy Maucherat wrote:
> Jan Luehe wrote:
> 
>> I may be totally wrong here, but it seems that if the
>> backgroundProcessorDelay property on a StandardContext is set to
>> something greater than zero (default is -1, inherited from
>> ContainerBase), the context's sessions are never purged.
>>
>> This is because in ContainerBase$ContainerBackgroundProcessor,
>> processChildren() is implemented as follows:
>>
>>     for (int i = 0; i < children.length; i++) {
>>         if (children[i].getBackgroundProcessorDelay() <= 0) {
>>             processChildren(children[i], cl);
>>         }
>>     }
>>
>> So when invoked from the ContainerBackgroundProcessor of a
>> StandardHost, only the sessions of those StandardContexts with a
>> backgroundProcessorDelay <=0 will get purged.
>>
>> I think the assumption is that if a StandardContext has a
>> backgroundProcessorDelay > 0, it would have its own
>> ContainerBackgroundProcessor spawn at startup. However, unlike
>> StandardEngine/Host/Wrapper, StandardContext.start() does not invoke
>> super.start(), and therefore a ContainerBackgroundProcessor is never
>> created for a StandardContext.
> 
> 
> Arg, stupid me, I forgot about that. We need to add the code which 
> starts the backgroud thread in StandardContext.start.
> So we need to call super.startThread() and super.stopThread. This 
> doesn't seem too hard.
> 
> Remy
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message