spree/spree — pull request #3808 by nishant-cyro (2013-10-02 06:14:40+00:00)
Title: Concurrency Issue.

Steps to reproduce

Add a variant which has only one quantity left and is not backorderable.
Add this variant by different users on two different browsers.
Now process the order and stop at the payment step. Choose the payment method.
On the other browser, choose the same payment method and stop.
Now, click on the Pay button from both browsers. Both orders get completed.
Check at admin end, count on hand of the stock item of that variant is -1.
This is replicable only with an high speed internet connection. Otherwise it can simulated by creating two or more processes.