From 2a114277fc7e90a81028db158caaff02298ad9a7 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 16 Jul 2009 18:28:50 +0000 Subject: [PATCH] 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 --- pisi/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index c3de3933..8d4a5cb9 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -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