Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mako templates cause uncaught KeyError in multithreaded environments under load #34

Open
homme opened this issue Sep 3, 2012 · 0 comments
Assignees

Comments

@homme
Copy link
Member

homme commented Sep 3, 2012

This thread suggests that the problem is in the use of the TemplateLookup class: it should only be instantiated once and used from a globally referenced variable which is currently not the case.

Note that the problem only manifests itself in a multithreaded persistent environment that is under load.

An example stack trace is as follows:

http://portal.oceannet.org/search/spatial/tms/1.0.0/bathymetry/12/4119/3273.png at 2012-09-01 04:42:11,217:
The application encountered an unhandled exception
File /data/www/medin_portal/python/errata.py, line 58, in __call__
return self.app(environ, start_response)
File /data/www/medin_portal/python/selector.py, line 161, in __call__
return app(environ, start_response)
File /data/www/medin_portal/python/medin/spatial.py, line 184, in tilecache
svc = get_tileservice(environ)
File /data/www/medin_portal/python/medin/spatial.py, line 168, in get_tileservice
template = lookup.get_template(mappath)
File /data/www/medin_portal/python/mako/lookup.py, line 85, in get_template
return self.__load(srcfile, uri)
File /data/www/medin_portal/python/mako/lookup.py, line 127, in __load
self.__collection[uri] = Template(uri=uri, filename=posixpath.normpath(filename), lookup=self, module_filename=(self.modulename_callable is not None and self.modulename_callable(filename, uri) or None), **self.template_args)
File /data/www/medin_portal/python/mako/template.py, line 84, in __init__
del sys.modules[self.module_id]
KeyError: 'config_tilecache_cfg'
@ghost ghost assigned homme Sep 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant