[zope2-tracker] [Bug 414757] [NEW] HTTPRequest.resolve_url clears site thread global

Martijn Pieters launchpad.net at zopatista.com
Mon Aug 17 07:11:37 EDT 2009


Public bug reported:

HTTPRequest.resolve_url clones the request to use a clean URL traversal
environment, then when done, calls .close() on the cloned request.
However, .close() emits an IEndRequestEvent event, which Five has
registered a clearThreadSiteSubscriber handler for. This means that any
and all persistent utility registrations in a nested site are no longer
available for the rest of the (non-cloned) original request.

For example, ZCatalog uses request.resolve_url to find any objects that
cannot be found through regular path traversal (see refreshCatalog,
manage_catalogObject and reindexIndex for examples). If for any reason,
there are stale entries in the catalog pointing to non-existing objects,
ZCatalog will automatically also try to use resolve_url to find the
object. A full reindex with stale objects thus leads to a reset of the
site manager, and any subsequent reindexing of attributes that require
access to persistent utilities fails.

The .resolve_url method should be altered to either not call .close() (a
simple "del req" should suffice) or a new .cleanup() method should be
added to do all cleanup work, which .resolve_url and .close then call,
with only the IEndRequestEvent emit remaining in .close.

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
HTTPRequest.resolve_url clears site thread global
https://bugs.launchpad.net/bugs/414757
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.


More information about the zope2-tracker mailing list