AttributeError: 'ResourceSystem' object has no attribute '_resource_managers_map'
|Reported by:||Christian Boos||Owned by:||Christian Boos|
How to Reproduce
While issuing a bunch of concurrent requests, I got the following traceback:
Traceback (most recent call last): File "C:\Workspace\src\trac\repos\0.11-stable\trac\web\main.py", line 445, in _dispatch_request dispatcher.dispatch(req) File "C:\Workspace\src\trac\repos\0.11-stable\trac\web\main.py", line 206, in dispatch resp = chosen_handler.process_request(req) File "C:\Workspace\src\trac\repos\0.11-stable\trac\wiki\web_ui.py", line 166, in process_request return self._render_view(req, versioned_page) File "C:\Workspace\src\trac\repos\0.11-stable\trac\wiki\web_ui.py", line 489, in _render_view req.href, format=conversion) File "C:\Workspace\src\trac\repos\0.11-stable\trac\resource.py", line 291, in get_resource_url manager = ResourceSystem(env).get_resource_manager(resource.realm) File "C:\Workspace\src\trac\repos\0.11-stable\trac\resource.py", line 238, in get_resource_manager if not self._resource_managers_map: AttributeError: 'ResourceSystem' object has no attribute '_resource_managers_map'
I already had similar failures in other testing sessions, and this amounts to a race condition in the ComponentManager, in source:trunk/trac/core.py, which can lead to methods of the component being called before the
__init__ method itself has been called.
The fix is not trivial, I somehow stopped working on it, but I think it's worth recording the problem anyway and eventually fix it one day.
Well, actually there is a trivial fix, which would be to set variables like
_resource_managers_map at the class level, which would avoid the internal error, but this ticket is more about solving the problem of
__init__ not being guaranteed to be called before other methods can be called.
Typical "low prio" but "high severity" kind of ticket, as this leads to an internal error but fortunately happens only once in a blue moon…
Change History (11)
comment:2 by , 11 years ago
|Milestone:||triaging → 0.12.1|
|Status:||new → assigned|