]> code.ossystems Code Review - openembedded-core.git/commitdiff
persist_data: handle locked db for SELECT
authorChris Larson <chris_larson@mentor.com>
Thu, 18 Nov 2010 17:54:10 +0000 (10:54 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:39 +0000 (14:46 +0000)
Parallel processes interacting with the persist_data db can quite easily
explode without this.

(Bitbake rev: b3d5432cff0ff28f4c8a5bcf10efa3e383b4fd4d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/persist_data.py

index 17975b64a5369e18b99e890d0fa4ffdc5d5f98ec..76bff16658651afae774b07a79e8364ea26184cd 100644 (file)
@@ -127,9 +127,7 @@ class PersistData:
         count = 0
         while True:
             try:
-                ret = self.cursor.execute(*query)
-                #print "Had to retry %s times" % count
-                return ret
+                return self.cursor.execute(*query)
             except sqlite3.OperationalError as e:
                 if 'database is locked' in str(e) and count < 500:
                     count = count + 1