June 14, 2011 @ 9:27 p.m.
Warning: technical database-related stuff ahead; skip to the last paragraph unless you are a nerd:
Ok - here is the problem: MySQL is HORRIBLE. I am switching as soon as I figure out how. I spent way too long trying to fix concurrency bugs that are resulting in things like challenges/word lists sometimes missing when you type in word, and then it gets marked wrong!! It's because once in a while the network can hiccup/lag for a split second and then it receives two answers simultaneously, and the changed state gets overwritten by the second one.
The solution is to use database locking when changing a shared state. This should work perfectly - except - IT DIDN'T SEEM TO FOREVER. I tried every possible combination of transaction levels, database logging, locking functions, etc., and every single time my code was blocking on a lock, once it was able to acquire the lock, it kept reading old data! The problem was that I needed to set the MySQL transaction isolation level from REPEATABLE-READ to READ-COMMITTED. Which is totally idiotic, because my transactions are ALREADY isolated across different gunicorn workers, and I was already finishing the transaction manually, so the default REPEATABLE-READ should have worked just fine. Anyway, yes, someone teach me how to use PostgreSQL.
In any case, I am pushing new code today at around 11 PM PST. It should be more stable in terms of missing words (i.e. it'll stop missing words and not screw with your score/saved lists anymore). It'll also get rid of the missed list showing duplicates bug. It'll be better now. Soon I will have time to do cool things like tracking which words get missed most often in the challenges (this is what the Bingo Toughies list will be every week), and many other features that I haven't had time to add since I was trying to fix these bugs. One more thing - a couple of people have complained of severe lag - like the timer freezes and skips, words take 10 seconds to register. Have people noticed this? Please let me know if you have. It shouldn't happen unless your browser is slow for some reason.
Please log in to comment on this post!
