On Wed, 22 Jun 2011 10:21:05 +1200, Michael Hudson-Doyle michael.hudson@linaro.org wrote:
Well, SQL isn't the right way to implement a queue in some ways, but I think we can make it work.
To be clear, I'm not saying we should stop modelling our job queue in the database.
In other news, I found a nicely simple way of making my problem go away: what we want to prevent is the same job being dispatched to multiple boards. So if we add a "current_job" column to the Device table and make it UNIQUE, then the problem goes away (this is a bit different from a solution to the full queuing problem as in principle overlapping requests for the same board could return the same job but that would be an application-level bug in our system).
Cheers, mwh