Ticket #714 (closed undecided: fixed)

Opened 2 years ago

Last modified 20 months ago

sqlite error on shutdown

Reported by: dustin Owned by: warner
Priority: blocker Milestone: 0.8.0
Version: master Keywords: schedulerdb
Cc:

Description

I predictably see this on buildmaster shutdown:

2010-02-15 20:47:27-0600 [-] Connection close failed
        Traceback (most recent call last):
          File "/home/dustin/code/buildbot/t/buildbot/sand24/lib/python2.4/site-packages/Twisted-9.0.0-py2.4-linux-x86_64.egg/twisted/internet/defer.py", line 307, in _startRunCallbacks
            self._runCallbacks()
          File "/home/dustin/code/buildbot/t/buildbot/sand24/lib/python2.4/site-packages/Twisted-9.0.0-py2.4-linux-x86_64.egg/twisted/internet/defer.py", line 323, in _runCallbacks
            self.result = callback(self.result, *args, **kw)
          File "/home/dustin/code/buildbot/t/buildbot/sand24/lib/python2.4/site-packages/Twisted-9.0.0-py2.4-linux-x86_64.egg/twisted/internet/base.py", line 410, in _continueFiring
            callable(*args, **kwargs)
          File "/home/dustin/code/buildbot/t/buildbot/sand24/lib/python2.4/site-packages/Twisted-9.0.0-py2.4-linux-x86_64.egg/twisted/enterprise/adbapi.py", line 374, in finalClose
            self._close(conn)
        --- <exception caught here> ---
          File "/home/dustin/code/buildbot/t/buildbot/sand24/lib/python2.4/site-packages/Twisted-9.0.0-py2.4-linux-x86_64.egg/twisted/enterprise/adbapi.py", line 420, in _close
            conn.close()
        pysqlite2.dbapi2.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 47460026382608 and this is thread id 47459928256864

Change History

comment:1 Changed 2 years ago by dustin

  • Priority changed from major to blocker

comment:2 Changed 2 years ago by Dustin J. Mitchell

  • Status changed from new to closed
  • Resolution set to fixed

fix thread leak, fix sqlite errors on shutdown, add tests

This fixes a major thread leak, by ensuring that the ConnectionPool?'s close() method always gets called (fixes #722). That method was triggering spurious errors from sqlite, but passing check_same_thread=False fixes that (and fixes #714). This also represents further work on #725 by adding new, well-isolated tests

Changeset: 5d41eef3718b79c034cab533f18354ad87f30f31

comment:3 Changed 20 months ago by Dustin J. Mitchell

fix thread leak, fix sqlite errors on shutdown, add tests

This fixes a major thread leak, by ensuring that the ConnectionPool?'s close() method always gets called (fixes #722). That method was triggering spurious errors from sqlite, but passing check_same_thread=False fixes that (and fixes #714). This also represents further work on #725 by adding new, well-isolated tests

Changeset: 5d41eef3718b79c034cab533f18354ad87f30f31

Note: See TracTickets for help on using tickets.