getlantern/lantern-controller — pull request #52 by aranhoide (2013-12-05 13:07:55+00:00)
Title: Add a small random delay when retrying transactions.

When a transaction fails because of a ConcurrentModificationException, retrying ASAP doesn't sound like the most reasonable thing to do. The proposed change adds a delay between half a second and a second and a half, so hopefully at some point one of the concurrent guys will have time to do its thing. The numbers were chosen to be well within GAE timeout times, leaving some time for the task's own work (we retry up to 10 times, so this adds a 15 second delay at the most.) They are a first guess, though, and I'm open to suggestions.