[Buildbot-commits] [Buildbot] #2005: SQLAlchemy Operational errors with SQLite: Database is locked
Buildbot
nobody at buildbot.net
Mon Jul 18 05:33:12 UTC 2011
#2005: SQLAlchemy Operational errors with SQLite: Database is locked
---------------------+-------------------------
Reporter: abompard | Owner:
Type: defect | Status: closed
Priority: critical | Milestone: 0.8.5
Version: 0.8.4p1 | Resolution: worksforme
Keywords: database |
---------------------+-------------------------
Changes (by dustin):
* version: 0.8.4 => 0.8.4p1
Comment:
I tried reproducing by writing to a table that's open in a read cursor, in
the same thread:
{{{
#!python
def test_busy(self):
meta = sa.MetaData()
tbl = sa.Table("tbl", meta, sa.Column("a", sa.INTEGER))
def add(conn):
meta.bind = conn
tbl.create()
conn.execute(tbl.insert(), [ dict(a=i) for i in xrange(1000)
])
for r in conn.execute(tbl.select()):
if r.a == 0:
conn.execute(tbl.insert(), a=9999)
d = self.pool.do(add)
return d
}}}
but this works fine (I'm on 3.7.6.3).
However, this fails:
{{{
#!python
def test_busy(self):
meta = sa.MetaData()
tbl = sa.Table("tbl", meta, sa.Column("a", sa.INTEGER))
def add(conn):
print "add"
meta.bind = conn
tbl.create()
conn.execute(tbl.insert(), [ dict(a=i) for i in xrange(100) ])
for r in conn.execute(tbl.select()):
time.sleep(0.1)
def foo(conn):
print "foo"
time.sleep(1)
meta.bind = conn
conn.execute(tbl.insert(), [ dict(a=i) for i in xrange(100) ])
d = defer.gatherResults([self.pool.do(add), self.pool.do(foo)])
return d
}}}
In particular, the insert in {{{foo}}} fails 5 seconds after it begins. I
think we *are* dealing with SQLITE_BUSY here, and it's being reported as
"database is locked". 5 seconds is the default wait timeout for locking
in sqlite3.
--
Ticket URL: <http://trac.buildbot.net/ticket/2005#comment:14>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the Commits
mailing list