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

Side by Side Diff: third_party/buildbot_8_4p1/buildbot/db/pool.py

Issue 2160913002: Re-land https://codereview.chromium.org/2108563002/ (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@reland-1
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Buildbot. Buildbot is free software: you can 1 # This file is part of Buildbot. Buildbot is free software: you can
2 # redistribute it and/or modify it under the terms of the GNU General Public 2 # redistribute it and/or modify it under the terms of the GNU General Public
3 # License as published by the Free Software Foundation, version 2. 3 # License as published by the Free Software Foundation, version 2.
4 # 4 #
5 # This program is distributed in the hope that it will be useful, but WITHOUT 5 # This program is distributed in the hope that it will be useful, but WITHOUT
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
8 # details. 8 # details.
9 # 9 #
10 # You should have received a copy of the GNU General Public License along with 10 # You should have received a copy of the GNU General Public License along with
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 if hasattr(engine, 'optimal_thread_pool_size'): 64 if hasattr(engine, 'optimal_thread_pool_size'):
65 pool_size = engine.optimal_thread_pool_size 65 pool_size = engine.optimal_thread_pool_size
66 threadpool.ThreadPool.__init__(self, 66 threadpool.ThreadPool.__init__(self,
67 minthreads=1, 67 minthreads=1,
68 maxthreads=pool_size, 68 maxthreads=pool_size,
69 name='DBThreadPool') 69 name='DBThreadPool')
70 self.engine = engine 70 self.engine = engine
71 if engine.dialect.name == 'sqlite': 71 if engine.dialect.name == 'sqlite':
72 vers = self.get_sqlite_version() 72 vers = self.get_sqlite_version()
73 log.msg("Using SQLite Version %s" % (vers,)) 73 log.msg("Using SQLite Version %s" % (vers,))
74 if vers < (3,7):
75 log.msg("NOTE: this old version of SQLite does not support "
76 "WAL journal mode; a busy master may encounter "
77 "'Database is locked' errors. Consider upgrading.")
74 if vers < (3,3,17): 78 if vers < (3,3,17):
75 log.msg("NOTE: this old version of SQLite does not support " 79 log.msg("NOTE: this old version of SQLite does not support "
76 "multiple simultaneous accesses to the database; " 80 "multiple simultaneous accesses to the database; "
77 "add the 'pool_size=1' argument to your db url") 81 "add the 'pool_size=1' argument to your db url")
78 brkn = self.__broken_sqlite = self.detect_bug1810() 82 brkn = self.__broken_sqlite = self.detect_bug1810()
79 if brkn: 83 if brkn:
80 log.msg("Applying SQLite workaround from Buildbot bug #1810") 84 log.msg("Applying SQLite workaround from Buildbot bug #1810")
81 self._start_evt = reactor.callWhenRunning(self._start) 85 self._start_evt = reactor.callWhenRunning(self._start)
82 86
83 def _start(self): 87 def _start(self):
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 except: 238 except:
235 return (0,) 239 return (0,)
236 240
237 if vers_row: 241 if vers_row:
238 try: 242 try:
239 return tuple(map(int, vers_row[0].split('.'))) 243 return tuple(map(int, vers_row[0].split('.')))
240 except (TypeError, ValueError): 244 except (TypeError, ValueError):
241 return (0,) 245 return (0,)
242 else: 246 else:
243 return (0,) 247 return (0,)
OLDNEW
« 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