When SIGTERM sent or any exception is caught, update_caches was run before

exiting because of the finally block...

But... the cache validity code looks if cached_dir stat.mtime is less than
cachefile.mtime... In this case cache file is updated but it may be updated
without any real update done on it after extracting package files... So it
was still keeping the old package info in memory and it was written without
being updated:

EXTRACT_FILES -> SIGTERM -> UPDATE_CACHE

but it has to be

EXTRACT_FILES -> UPDATE_DB (in memory) -> UPDATE_CACHE

this may also be done with really checking if any update is done in that db
file before saving cache... but this is easier

BUG:FIXED:10469
This commit is contained in:
Faik Uygur
2009-07-16 18:28:50 +00:00
parent 195d5c65e7
commit 2a114277fc
+3 -2
View File
@@ -67,9 +67,10 @@ def locked(func):
try:
pisi.db.invalidate_caches()
return func(*__args,**__kw)
finally:
ret = func(*__args,**__kw)
pisi.db.update_caches()
return ret
finally:
lock.close()
return wrapper