Roundup Tracker - Issues

Message5811

Author rouilj
Recipients ber, mpm, rouilj
Date 2016-07-10.17:06:37
Message-id <1468170398.44.0.373065742138.issue2550727@psf.upfronthosting.co.za>
In-reply-to
I am attaching a patch that should work round pysqlite's
handling of transactions and properly create an exclusive
lock on the ids table while getting a new id.

Note the inline patch I submitted before didn't do the trick
in a small test case. I think it's because the exclusive lock
only fires when I try to use DML (data modification language)
and not between the query and the update.

This should stop the duplicate id's returned when different
processes are accessing the table.

This patch passes the full sqlite test suite.  I tried to make 

  test/test_sqlite.py::sqliteConcurrencyTest::testConcurrency

fail using the original so I could see if it passed with this patch.
But I couldn't reproduce the fail using the test suite. I also tried it
using scripts/add_issue after 500 issues added I didn't get any
exceptions raised. So I guess I don't have a powerful enough
laptop to generate the collisions.
History
Date User Action Args
2016-07-10 17:06:38rouiljsetmessageid: <1468170398.44.0.373065742138.issue2550727@psf.upfronthosting.co.za>
2016-07-10 17:06:38rouiljsetrecipients: + rouilj, ber, mpm
2016-07-10 17:06:38rouiljlinkissue2550727 messages
2016-07-10 17:06:38rouiljcreate