Tuesday, December 2, 2008

A Potentially Nasty Bug

I had a productive day today, but it wasn't on Groupthink. Got a little bit of work in on one of the Permissions tasks and hopefully I'll wrap it up tomorrow.

But, I did discover and fix what could have been a really nasty bug to track down. Simply put, because multiple people can edit the permissions of a project, it's possible for two people to try to make a permissions change at the exact same instant. And I was not doing the update in a transaction. But, because of the way Google App Engine projects work, using a transaction has a downside -- it doesn't just lock out changes to permissions, it locks out changes to the entire project. So, I changed the code to use a transaction, but only in the case where the project already has more than one owner. I'm also going to look into moving the permissions into a separate table, so that the transaction doesn't lock the whole project, but that's a change that can wait until post-launch. The tradeoff is how often it happens versus how much it slows the system down when it's not happening.

0 comments:

Post a Comment