Merge lp:~javier.collado/utah/bug1095669 into lp:utah

Proposed by Javier Collado
Status: Merged
Approved by: Max Brustkern
Approved revision: 802
Merged at revision: 802
Proposed branch: lp:~javier.collado/utah/bug1095669
Merge into: lp:utah
Diff against target: 34 lines (+6/-1)
2 files modified
utah/config.py (+3/-0)
utah/provisioning/inventory/sqlite.py (+3/-1)
To merge this branch: bzr merge lp:~javier.collado/utah/bug1095669
Reviewer Review Type Date Requested Status
UTAH Dev Pending
Review via email: mp+144266@code.launchpad.net

Description of the change

As explained in the bug comments, this is not a solution, but a workaround to
have a greater timeout than sqlite3's default and check if the issue goes away.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

This looks like a good potential solution, and much simpler than what I was envisioning. I think it's worth a try.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utah/config.py'
2--- utah/config.py 2012-12-17 19:55:15 +0000
3+++ utah/config.py 2013-01-22 10:40:25 +0000
4@@ -137,6 +137,9 @@
5 wwwdir=os.path.join('/', 'var', 'www', 'utah'),
6 # Default VM XML file
7 xml=os.path.join('/', 'etc', 'utah', 'default-vm.xml'),
8+ # sqlite database connection timeout
9+ # a value higher than the default is used to avoid db locking problems
10+ sqlite3_db_connection_timeout=30,
11 )
12
13 # These depend on the local user/path, and need to be filtered out
14
15=== modified file 'utah/provisioning/inventory/sqlite.py'
16--- utah/provisioning/inventory/sqlite.py 2012-12-12 20:25:24 +0000
17+++ utah/provisioning/inventory/sqlite.py 2013-01-22 10:40:25 +0000
18@@ -18,6 +18,7 @@
19 import sqlite3
20 import os
21 from utah.provisioning.inventory.inventory import Inventory
22+from utah import config
23
24
25 class SQLiteInventory(Inventory):
26@@ -29,7 +30,8 @@
27 db = os.path.expanduser(db)
28 super(SQLiteInventory, self).__init__(*args, uniqueid=db, **kw)
29 self.db = db
30- self.connection = sqlite3.connect(self.db)
31+ self.connection = sqlite3.connect(self.db,
32+ config.sqlite3_db_connection_timeout)
33 self.connection.isolation_level = None
34 self.connection.row_factory = sqlite3.Row
35

Subscribers

People subscribed via source and target branches