fog/fog — pull request #2474 by anl (2013-12-11 15:24:20+00:00)
Title: Add exponential backoff to Google Compute Engine's backoff_if_unfound.

Even with backoff_if_unfound, I frequently see Fog::Errors::NotFound when creating a GCE instance. For me, this happens most often in europe-west1-b, about 50% of the time; I see the same thing, but less often, in us-central zones. Adding an exponential backoff factor to backoff_if_unfound resolved this issue for me.

I arrived at a backoff factor of 1.6 by finding the minimum value at which the existing value of up to 10 retries would reliably succeed for me. It's unclear to me if the Fog::Errors::NotFound errors occur because of (my lack of) physical proximity - I'm on the west coast of the United States - or if there's something unique about europe-west1-b. As such, the backoff factor and retry count may need adjustment for other users.