Ok, thanks.  I’ll review it more carefully.

From: Victor Lowther [mailto:notifications@github.com]
Sent: Saturday, October 12, 2013 3:30 PM
To: crowbar/barclamp-crowbar
Cc: Hirschfeld, Rob
Subject: Re: [barclamp-crowbar] Fix several Run-related race conditions [1/4] (#732)


In crowbar_framework/app/models/run.rb:

>      end

>    end

>

>    def self.empty?

>      cleanup

> -    Run.all.count == 0

> +    Run.transaction do
On Oct 12, 2013 2:04 PM, "Rob Hirschfeld" <notifications@github.com<mailto:notifications@github.com>> wrote: In crowbar_framework/app/models/run.rb: > end > end > > def self.empty? > cleanup > - Run.all.count == 0 > + Run.transaction do Why end with true?
It just does the count in a transaction with the table locked. It is just a block, not a loop.
…
— Reply to this email directly or view it on GitHub.

—
Reply to this email directly or view it on GitHub<https://github.com/crowbar/barclamp-crowbar/pull/732/files#r6932716>.