Bertrand Delacretaz wrote:
touch 12011200 sitemap.xmap
reproduces the disposed ComponentLocator problem!
Definitely reproducible, see new comments in http://issues.apache.org/bugzilla/show_bug.cgi?id=27249
Spotted the problems, which are actually twofold in the TreeProcessor:
- sitemap modification date is checked to be before or equal to the date when the treeprocessor was built, meaning continuous rebuild if the sitemap date is in the future
- treeprocessor disposal (and hence its component manager) occurs as soon as change is detected, even if some other request (either in another thread or through a "cocoon:") currently use that treeprocessor, leading to the IllegalStateExceptions
The first problem is easy to solve, but the second one is more tricky. My current thinking about it is to add a concurrent requests counter and disposal flag. When a sitemap change is detected the flag is set to true. The treeprocessor will be disposed if the disposal flag is true _and_ the concurrent requests counter is zero.
Time to sleep now. I'll see if this still seems to be a good solution when waking up and implement it, unless someone else is faster or has a better idea ;-)
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
