** Description changed: [Impact] Concurrency issues in lazr.restfulclient are affecting some processes used by various teams; including Foundations, PS integration, etc. The most affected users are those who make heavy use of scheduled tasks around launchpadlib (see bug 513116); where different calls to various parts of launchpadlib (or the bzr launchpad plugin) will concurrently try to access cache, step on each others' cache files and mangle the files causing errors for further calls using lazr.restfulclient / launchpadlib. [Test case] 1) Update package. 2) Run the following command: for i in `seq 1 50` ; do python -c 'from launchpadlib.launchpad import Launchpad; lp = Launchpad.login_anonymously("test-cache", "production"); lp.distributions["ubuntu"]' & ; done After a few runs, on an affected system the spawned processes will write out backtraces due to mangled files, such as the following error: cElementTree.ParseError: not well-formed (invalid token): line 40599, column 18 On a patched system, all spawned processes will terminate successfully. [Regression Potential] - + Due to the changes in caching method, it may be possible that lazr.restfulclient fails to write cache files because of path size (which would likely increase due to the change), or otherwise fails to properly cache data increasing delays in retrieving information that may have already been retrieved. ---- httplib2 says: class FileCache(object): """Uses a local directory as a store for cached files. Not really safe to use if multiple threads or processes are going to. be running on the same cache. """ launchpadlib sub-classes that, but doesn't change that fact. This means that with multiple processes or threads you will suddenly get strange error messages (bug 404204). This is made worse by the fact that creating an object uses a global cache, and login_with does this with no way to override it. The best way to fix this is to just fix the cache implementation rather than everyone learning to use a private cache and fixing launchpadlib to make this possible with the convenience methods. This is a pre-requisite for fixing bug 513116, which is about the fact that launchpadlib is not thread-safe.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/459418 Title: Cache is not safe for concurrent use (by processes or threads) To manage notifications about this bug go to: https://bugs.launchpad.net/launchpad/+bug/459418/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs