OLD | NEW |
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 pool_size = engine.optimal_thread_pool_size | 43 pool_size = engine.optimal_thread_pool_size |
44 | 44 |
45 threadpool.ThreadPool.__init__(self, | 45 threadpool.ThreadPool.__init__(self, |
46 minthreads=1, | 46 minthreads=1, |
47 maxthreads=pool_size, | 47 maxthreads=pool_size, |
48 name='DBThreadPool') | 48 name='DBThreadPool') |
49 self.engine = engine | 49 self.engine = engine |
50 if engine.dialect.name == 'sqlite': | 50 if engine.dialect.name == 'sqlite': |
51 vers = self.get_sqlite_version() | 51 vers = self.get_sqlite_version() |
52 log.msg("Using SQLite Version %s" % (vers,)) | 52 log.msg("Using SQLite Version %s" % (vers,)) |
| 53 if vers < (3,7): |
| 54 log.msg("NOTE: this old version of SQLite does not support " |
| 55 "WAL journal mode; a busy master may encounter " |
| 56 "'Database is locked' errors. Consider upgrading.") |
53 if vers < (3,3,17): | 57 if vers < (3,3,17): |
54 log.msg("NOTE: this old version of SQLite does not support " | 58 log.msg("NOTE: this old version of SQLite does not support " |
55 "multiple simultaneous accesses to the database; " | 59 "multiple simultaneous accesses to the database; " |
56 "add the 'pool_size=1' argument to your db url") | 60 "add the 'pool_size=1' argument to your db url") |
57 brkn = self.__broken_sqlite = self.detect_bug1810() | 61 brkn = self.__broken_sqlite = self.detect_bug1810() |
58 if brkn: | 62 if brkn: |
59 log.msg("Applying SQLite workaround from Buildbot bug #1810") | 63 log.msg("Applying SQLite workaround from Buildbot bug #1810") |
60 self._start_evt = reactor.callWhenRunning(self._start) | 64 self._start_evt = reactor.callWhenRunning(self._start) |
61 | 65 |
62 def _start(self): | 66 def _start(self): |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 except: | 202 except: |
199 return (0,) | 203 return (0,) |
200 | 204 |
201 if vers_row: | 205 if vers_row: |
202 try: | 206 try: |
203 return tuple(map(int, vers_row[0].split('.'))) | 207 return tuple(map(int, vers_row[0].split('.'))) |
204 except (TypeError, ValueError): | 208 except (TypeError, ValueError): |
205 return (0,) | 209 return (0,) |
206 else: | 210 else: |
207 return (0,) | 211 return (0,) |
OLD | NEW |