DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6362>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6362

Multithreading problems during regeneration of sitemap

           Summary: Multithreading problems during regeneration of sitemap
           Product: Cocoon 2
           Version: Current CVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hi,

I just found out this problem with the asynchronous sitemap generation:

If you change the sitemap in a running system the sitemap is regenerated
in the background. In the meantime all incomming requests are served with
the old sitemap until the new one is finished. This is nice.

But, if a new request enters the old sitemap and is in the processing of
this
sitemap and if at the same time the regeneration is finished, the old
sitemap
is released by the sitemap.handler class.

>> taken from the run() method <<
            if (this.sitemap != null) {
                programGenerator.release((CompiledComponent)this.sitemap);
            }
<<

This release causes a dispose on the Sitemap object which in turn resets the
sitemap object and for example sets the manager to null.
But the new requests is currently processing with the old sitemap object
which
then results sooner or later with a NPE (as the manager is now null).

This is easily reproducable. just change the sitemap and hit several times
on
reload.

Now, I see two solutions:
a) Each request looksup and releases the sitemap, so the release in the
run()
method of the handler will not dispose the old sitemap until all requests
still
using that old sitemap are finished.
b) Remove the asynchron regeneration.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to