Comment 2 for bug 90098

Revision history for this message
Gavin Panella (allenap) wrote :

checkwatches still runs with SERIALIZABLE transaction isolation. I'm not sure what the repercussions would be from switching to READ COMMITTED, but I'm wary of going to AUTOCOMMIT; for the comment syncing part especially, checkwatches does set up more complex data structures, and I would not want it to leave half-finished stuff around. Even apparently simple tasks like updating a bug task status has many side-effects, including sending email to bug subscribers.

However, since last month, transactions are now short and ring-fenced in checkwatches.

Using the helpers in lp.bugs.externalbugtracker.isolation, it's now an error for checkwatches to begin network activity when there's a transaction in progress. This means that checkwatches must be careful about transaction boundaries, see the BugWatchUpdater.transaction context manager for how that has been approached.

A side benefit of this is to make the developers much more aware of what demands are being made of the database and when. It makes it obvious where we can optimize, or need to.

I'm marking this bug as Won't Fix because the discipline the code must not exhibit seems to make it unnecessary, but I'm interested in a discussion on this if there's disagreement.