From: Zac Medico Date: Fri, 22 Sep 2006 21:26:37 +0000 (-0000) Subject: Don't use LazyLoad for cache pulls because it causes a race condition. X-Git-Tag: v2.1.1-r1~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=975e4544a340d267b6e00fc501891dfdc273e70d;p=portage.git Don't use LazyLoad for cache pulls because it causes a race condition. svn path=/main/trunk/; revision=4503 --- diff --git a/pym/cache/sqlite.py b/pym/cache/sqlite.py index 40b0b9a9e..571eff39b 100644 --- a/pym/cache/sqlite.py +++ b/pym/cache/sqlite.py @@ -4,8 +4,7 @@ from cache import fs_template from cache import cache_errors -import errno, os, stat -from cache.mappings import LazyLoad, ProtectedDict +import os from cache.template import reconstruct_eclasses from portage_util import writemsg, apply_secpass_permissions from portage_data import portage_gid @@ -138,15 +137,6 @@ class database(fs_template.FsBased): raise cache_errors.InitializationError(self.__class__,"actual synchronous = "+actual_synchronous+" does does not match requested value of "+synchronous) def __getitem__(self, cpv): - if not self.has_key(cpv): - raise KeyError(cpv) - def curry(*args): - def callit(*args2): - return args[0](*args[1:]+args2) - return callit - return ProtectedDict(LazyLoad(curry(self._pull, cpv))) - - def _pull(self, cpv): cursor = self._db_cursor cursor.execute("select * from %s where %s=%s" % \ (self._db_table["packages"]["table_name"],