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

Pierre Tardy tardyp at gmail.com
Mon Feb 13 08:14:55 UTC 2017


Hi Craig,

Even with one thread there is still the main thread and the db thread.
I have spent already a bunch of time trying to fix this warning (on py2).
Looking at the source of sqlalchemy it looked actually harmless.
Now it is a plain error, It looks like we will need to look again and fix
it.
I see that nocolor did a try at it but it didn't work

Pierre


Le lun. 13 févr. 2017 à 05:37, Craig Rodrigues <rodrigc at crodrigues.org> a
écrit :

> 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
>
>
> _______________________________________________
> devel mailing list
> devel at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/devel/attachments/20170213/8cd6d658/attachment.html>


More information about the devel mailing list