Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-05-06 Thread Sylvain Laurent
I finally proposed a patch for trunk in https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 for this. Thanks for reviewing it... Sylvain On 30 avr. 2010, at 18:27, Sylvain Laurent wrote: On 30 avr. 2010, at 00:01, Pid wrote: Are you saying that you want to stop processing requests

RE: Need advice to notify StandardExecutor when a webapp is stopped

2010-05-06 Thread Caldarale, Charles R
From: Sylvain Laurent [mailto:sylvain.laur...@gmail.com] On Behalf Of Sylvain Laurent Subject: Re: Need advice to notify StandardExecutor when a webapp is stopped An improvement I can do is to pre-start some core threads in the new pool before making it active. It would reduce the

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-30 Thread Sylvain Laurent
Interesting idea, really ! But I suspect it might break some things in some cases. I'm thinking about cross-context requests (where the requestDispatcher calls another web application in the same JVM with the same thread). If the context-specific table changes when dispatching the request to

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-30 Thread Sylvain Laurent
On 30 avr. 2010, at 00:01, Pid wrote: Are you saying that you want to stop processing requests each time a webapp gets restarted, or that the thread pool is refreshed by sequentially killing each thread and recreating it? Something in between : I create a new pool with the same

RE: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-30 Thread Caldarale, Charles R
From: Sylvain Laurent [mailto:sylvain.laur...@gmail.com] On Behalf Of Sylvain Laurent Subject: Re: Need advice to notify StandardExecutor when a webapp is stopped Interesting idea, really ! But I suspect it might break some things in some cases. I'm thinking about cross-context requests

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-29 Thread Sylvain Laurent
If I understand you and your comment here https://issues.apache.org/bugzilla/show_bug.cgi?id=49159#c2 you propose to clean only thread locals loaded by a web app. But how do you recognize them ? If the value bound to a threadlocal is an ArrayList, you won't be able to tell that it was loaded

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-29 Thread Sylvain Laurent
While experimenting with clearing threadlocal in afterExecute, I found out that tomcat itself use ThreadLocal in hope of improving performance : - org.apache.catalina.util.DateTool - org.apache.catalina.valves.AccessLogValve - org.apache.tomcat.util.http.ServerCookie - ... this is mainly to

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-29 Thread Pid
On 29/04/2010 22:52, Sylvain Laurent wrote: While experimenting with clearing threadlocal in afterExecute, I found out that tomcat itself use ThreadLocal in hope of improving performance : - org.apache.catalina.util.DateTool - org.apache.catalina.valves.AccessLogValve -

RE: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-29 Thread Caldarale, Charles R
From: Caldarale, Charles R Subject: RE: Need advice to notify StandardExecutor when a webapp is stopped This is an area where some byte code modification might be appropriate in a container environment, so that the ThreadLocal behavior could be modified to be ContextLocal instead.

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-29 Thread Pid
On 29/04/2010 21:50, Sylvain Laurent wrote: If I understand you and your comment here https://issues.apache.org/bugzilla/show_bug.cgi?id=49159#c2 you propose to clean only thread locals loaded by a web app. But how do you recognize them ? If the value bound to a threadlocal is an ArrayList,

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-28 Thread Mark Thomas
On 27/04/2010 15:57, Sylvain Laurent wrote: Do you mean one declared in server.xml ? or have the StandardThreadExecutor register itself as a LifeCycleListener ? In the latter case, my problem is how do I get a reference to StandardContext instances from the StandardThreadExecutor ? I'm not

Re: Need advice to notify StandardExecutor when a webapp is stopped

2010-04-27 Thread Konstantin Kolinko
2010/4/27 Sylvain Laurent sylvain.laur...@m4x.org: Hello, In order to provide a protection agains this type of memory leak http://wiki.apache.org/tomcat/MemoryLeakProtection#webappClassInstanceAsThreadLocalIndirectValue , I experimented with renewing the ThreadPoolExecutor in the