summaryrefslogtreecommitdiffstats
path: root/bitbake
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
parent31709ed0afe6e5254eabf7036fcf0f2228802dbb (diff)
downloadpoky-2ab1bf27f79beadc45e86a26c85fc0b95ae3496f.tar.gz
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')
-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):
43 continue 43 continue
44 raise exc 44 raise exc
45 45
46 def sync(self):
47 self.conn.commit()
48 self._execute("BEGIN EXCLUSIVE TRANSACTION")
49
46 def _getValueHist(self, version, pkgarch, checksum): 50 def _getValueHist(self, version, pkgarch, checksum):
47 data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table, 51 data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
48 (version, pkgarch, checksum)) 52 (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):
74 except: 74 except:
75 self.handle_error(request, client_address) 75 self.handle_error(request, client_address)
76 self.shutdown_request(request) 76 self.shutdown_request(request)
77 77 self.table.sync()
78 78
79 def process_request(self, request, client_address): 79 def process_request(self, request, client_address):
80 self.requestqueue.put((request, client_address)) 80 self.requestqueue.put((request, client_address))
@@ -120,6 +120,7 @@ class PRServer(SimpleXMLRPCServer):
120 while not self.quit: 120 while not self.quit:
121 self.handle_request() 121 self.handle_request()
122 122
123 self.table.sync()
123 logger.info("PRServer: stopping...") 124 logger.info("PRServer: stopping...")
124 self.server_close() 125 self.server_close()
125 return 126 return