Where is the cache stored, and which Lock class are you using?
Application globals are tricky in Pyramid. One place you can store
them is a registry attribute (request.registry.myattr); I use this for
SQLAlchemy engines. Or you could stuff it into the configuration
settings at startup. The registry has a native API for global objects
but it's kind of complicated; 'pyramid_services' makes it more
intuitive. But that may be overkill for one simple object.
If your cache lookup is in view code; I'd encapsulate it into a
request method, to decouple the views from the cache location.
Logging entries usually include the module name, so that's not
unusual. What's unusual is it's not fully qualified (
'myapp.lib.agent_cache'). You may have disabled displaying the parents
in the logging configuration, or more worrisome, it may be importing
it as a top-level import or switching between two different
'agent_cache' modules. You can print or log ``repr(agent_cache)`` to
see where it comes from and its parents.
Mike Orr <slugg...@gmail.com