[devel at bb.net] Request for Python 3 porting help: threads and SQLite problem

Craig Rodrigues rodrigc at crodrigues.org
Mon Feb 13 04:37:31 UTC 2017


Hi,

I followed these steps to set up a Python 3.6 build environment:

https://lists.buildbot.net/pipermail/devel/2017-February/012310.html

If run this test:

trial buildbot.test.unit.test_db_pool

I get this error:

Exception closing connection <sqlite3.Connection object at 0x1052bfb90>
Traceback (most recent call last):
  File
"/Users/crodrigues/.pyenv/versions/venv-3.5.2/lib/python3.5/site-packages/sqlalchemy/pool.py",
line 300, in _close_connection    self._dialect.do_close(connection)
  File
"/Users/crodrigues/.pyenv/versions/venv-3.5.2/lib/python3.5/site-packages/sqlalchemy/engine/default.py",
line 446, in do_close
    dbapi_connection.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be
used in that same thread.The object was created in thread id
123145392500736 and this is thread id 140736404648896

I looked into the code and saw that this line in enginestrategy.py:
https://github.com/buildbot/buildbot/blob/master/master/buildbot/db/enginestrategy.py#L171

restricts max_conns to 1 if the database is SQLite.  This *should* restrict
things
to only one thread in the dbpool.
I can't figure out what's going on here.

I would greatly appreciate if someone could help with this!

--
Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/devel/attachments/20170212/d7966a5c/attachment.html>


More information about the devel mailing list