Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: third_party/buildbot_8_4p1/buildbot/db/pool.py

Issue 2101993002: Cherry-pick buildbot 6bd279caf945e51882a1126288355528db68c769: (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@buildbot-docs
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/buildbot_8_4p1/buildbot/db/pool.py
diff --git a/third_party/buildbot_8_4p1/buildbot/db/pool.py b/third_party/buildbot_8_4p1/buildbot/db/pool.py
index 5482e1196ecfddca6a42f970da878aea1cd2bee5..ea3df35af4e7b6f2b3c91b5758178bbc1cd34ef0 100644
--- a/third_party/buildbot_8_4p1/buildbot/db/pool.py
+++ b/third_party/buildbot_8_4p1/buildbot/db/pool.py
@@ -48,8 +48,15 @@ class DBThreadPool(threadpool.ThreadPool):
name='DBThreadPool')
self.engine = engine
if engine.dialect.name == 'sqlite':
- log.msg("applying SQLite workaround from Buildbot bug #1810")
- self.__broken_sqlite = self.detect_bug1810()
+ vers = self.get_sqlite_version()
+ log.msg("Using SQLite Version %s" % (vers,))
+ if vers < (3,3,17):
+ log.msg("NOTE: this old version of SQLite does not support "
+ "multiple simultaneous accesses to the database; "
+ "add the 'pool_size=1' argument to your db url")
+ brkn = self.__broken_sqlite = self.detect_bug1810()
+ if brkn:
+ log.msg("Applying SQLite workaround from Buildbot bug #1810")
self._start_evt = reactor.callWhenRunning(self._start)
def _start(self):
@@ -179,3 +186,22 @@ class DBThreadPool(threadpool.ThreadPool):
# but this version should not fail..
test(select_from_sqlite_master=True)
return False # not broken - no workaround required
+
+ def get_sqlite_version(self):
+ engine = sa.create_engine('sqlite://')
+ conn = engine.contextual_connect()
+
+ try:
+ r = conn.execute("SELECT sqlite_version()")
+ vers_row = r.fetchone()
+ r.close()
+ except:
+ return (0,)
+
+ if vers_row:
+ try:
+ return tuple(map(int, vers_row[0].split('.')))
+ except (TypeError, ValueError):
+ return (0,)
+ else:
+ return (0,)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698