Comment 2 for bug 621364

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

This is only sort of related to start up time. The first time that a template is called in BFG, BFG uses the ZCA registry to cache the "renderer" generated for that template. My best guess, looking at the stack trace above, is that another thread attempted to mutate the registry at the same time as this one, probably from another template call and the subsequent caching of the renderer. The registerUtility method of the ZCA registry looks to not be threadsafe as one thread can mutate a Python dictionary while another thread attempts to iterate over its items. I have verified that the same call to iteritems is made in the most recent release of zope.component, so upgrading is not likely to help. This would need to be fixed in zope.component, unless it specifically professes to be non-threadsafe, in which case we would need to implement some sort of locking on the registry at the BFG level. You could think of this as being tangentially related to application startup, since these utility registrations are only

We don't seem to be at very much risk--the potential for hitting this bug has been present since the very beginning of Karl3 and we've never seen it until now, so I'd say this is not very urgent.