You are absolutely correct that the code is not handling db.Timeout exceptions correctly. When I wrote the recipe, I could not simulate Timeouts on the production datastore, so I wrote some code to randomly raise db.Timeouts and tested that the exponential backoff worked well. Today, after load testing with 'ab' to hammer a test app in production, I could still not simulate a db.Timeout, but I could produce some TransactionFailedErrors and instead attempted to catch and retry those. It turns out apiproxy_stub_map.MakeSyncCall does not raise db.Timeout or db.TransactionFailedError, it raises a lower level Exception. The recipe is now updated in the cookbook to catch the correct low level exception.
http://appengine-cookbook.appspot.com/recipe/autoretry-datastore-timeouts Under load, I can see the retries in my log output. If you are able to consistently produce db.Timeouts in production, please let me know that it is working for you too. Thanks for the helpful feedback, Robin On Oct 20, 5:09 pm, johntray <[email protected]> wrote: > Has anyone reported problems using the autoretry cookbook method? I > added a log message to check that the wrapper is getting installed, > and I also added a log message in the retry loop. I see the log > message that the wrapper is installed, however, I do *not* see any > retry-log messages despite getting datastore timeouts. > > For what it is worth, I also used the development server to verify > that the wrapper is indeed getting called, but of course, I don't > experience datastore timeouts there. > > Has anyone else had problems with this code? > john > > On Sep 30, 10:25 pm, Mike Wesner <[email protected]> wrote: > > > I saw this lower level way to handle Timeouts. Seems like the best > > way to handle it. No need to decorate or litter your code with retry > > stuff. > > >http://appengine-cookbook.appspot.com/recipe/autoretry-datastore-time... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
