summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-08 09:45:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-08 10:51:56 +0100
commit2ab1bf27f79beadc45e86a26c85fc0b95ae3496f (patch)
treebddf3a9ecd185960cdeadad07dcda5f96e3a724e /bitbake/lib/prserv
parent31709ed0afe6e5254eabf7036fcf0f2228802dbb (diff)
downloadpoky-2ab1bf27f79beadc45e86a26c85fc0b95ae3496f.tar.gz
poky-2ab1bf27f79beadc45e86a26c85fc0b95ae3496f.tar.bz2
poky-2ab1bf27f79beadc45e86a26c85fc0b95ae3496f.zip
bitbake: prserv: Ensure data is committed
In exclusive mode, we need to complete the transaction for writes to make it to the database. Therefore add sync calls to ensure this happens. Autocommit mode is significantly (100 times) slower so caching the data is of significant benefit. (Bitbake rev: 4e55f7821786a59c2cd7dbd8bfa2a22f5f196e99) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv')
-rw-r--r--bitbake/lib/prserv/db.py4
-rw-r--r--bitbake/lib/prserv/serv.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
index 559935544a..86eafe338c 100644
--- a/bitbake/lib/prserv/db.py
+++ b/bitbake/lib/prserv/db.py
@@ -43,6 +43,10 @@ class PRTable(object):
continue
raise exc
+ def sync(self):
+ self.conn.commit()
+ self._execute("BEGIN EXCLUSIVE TRANSACTION")
+
def _getValueHist(self, version, pkgarch, checksum):
data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
(version, pkgarch, checksum))
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index a9c7ed104c..7864594bb6 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -74,7 +74,7 @@ class PRServer(SimpleXMLRPCServer):
except:
self.handle_error(request, client_address)
self.shutdown_request(request)
-
+ self.table.sync()
def process_request(self, request, client_address):
self.requestqueue.put((request, client_address))
@@ -120,6 +120,7 @@ class PRServer(SimpleXMLRPCServer):
while not self.quit:
self.handle_request()
+ self.table.sync()
logger.info("PRServer: stopping...")
self.server_close()
return