[Bug 459418] [lazr.restfulclient/precise] verification still needed
Ubuntu Foundations Team Bug Bot
459418 at bugs.launchpad.net
Sat Sep 14 19:30:05 UTC 2013
The fix for this bug has been awaiting testing feedback in the -proposed
repository for precise for more than 90 days. Please test this fix and
update the bug appropriately with the results. In the event that the
fix for this bug is still not verified 15 days from now, the package
will be removed from the -proposed repository.
** Tags added: removal-candidate
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lazr.restfulclient in Ubuntu.
https://bugs.launchpad.net/bugs/459418
Title:
Cache is not safe for concurrent use (by processes or threads)
Status in lazr.restfulclient:
Fix Released
Status in “lazr.restfulclient” package in Ubuntu:
Fix Released
Status in “lazr.restfulclient” source package in Precise:
Fix Committed
Status in “lazr.restfulclient” source package in Quantal:
Fix Committed
Bug description:
[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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/lazr.restfulclient/+bug/459418/+subscriptions
More information about the foundations-bugs
mailing list