|
Attaching a patch (timer.patch) that makes the eviction timer a (lazy initialized) instance variable in GOP, GKOP and cancels it in close. Questions:
1. Will this resolve the issue fully? This fix breaks binary compatibility but only at package private level.
One question which may need to investigated is whether any subtle concurrency issues are prevent by using a static instance. I've taken a look at the code and i can only see it being used to set up eviction timings. Not sure whether these are ever cleared out. So, the instance will ensure the pool remains in memory until the server is restarted. More eyes would be good since it's very easy to miss subtle concurrency issues. I suppose that some benchmarks would be the right way to assess the performance impact of this patch. A more complex solution would be to create a private subclass of timer that does knows when to unschedule eviction tasks. The evictor would need to implement a package interface (unschedulable?) and then test for the pool being closed (or something like that). This would be quite a bit more effort with more to go wrong. A more conservative solution would be to revert to the pool 1.2 setup where the Evictor is a thread. This would also break backward compatibility at the package private level, but would revert to a well-tested solution with essentially the same scaling / perfornance challenges as the per instance Timer in the patch. See
I don't see the package private as an issue.
I can reproduce this. I have been thinking about a solution that would fix this and
A fix that would not re-open
This patch fixes
I have tested this with the latest Tomcat 5.5.x and the problem described in http://issues.apache.org/bugzilla/show_bug.cgi?id=43552 My aim was to stick to the commons-pool coding conventions but if this patch is viewed as not doing things in the commons-pool way then I won't be offended if you ask me to re-write it or if it is committed in a completely different form. Updated patch. I missed a call to _evictor.cancel() in GKOP
Patch (v2) applied in r602765. Thanks!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Undeploy/deploy does not work unless I restart the server. Exactly the same phenomenon...