Hi there, Having got my application to a barely working state last week, I tried to demonstrate it to a friend. Before he had even reached the main page of the application, a Datastore timeout had occurred while updating his session record. I talked to a few people about this, and it seems when this occurs it is usually safe to retry the operation a few times. I've been thinking about this issue a little since then, and have reached the conclusion that my application code should not need to be handling this explicitly at all. I considered the following avenues for continuity in the face of a Datastore timeout:
* Somehow use memcache as an alternative. This assumes that during some future request, my code would eventually retry the operation and it would succeed, and in the meantime, memcache does not get flushed. Anywhere this kind of data needs accessed, my code would need to explicitly check both memcache and the datastore. Basically this seems like a dumb thing to attempt. * Use some alternative storage via urlfetch. This seems pretty much insane. * Return a friendly error message This seems premature unless we've already retried the operation a few times. * Retry the operation. Leaving the fourth option, which seems to me, should be the default. I've been trying to think of the downsides of wrapping or monkey-patching the Datastore API to always automatically retry, and I'm coming up blank. I can imagine there are cases when such automatic behaviour might not be ideal, and so, perhaps providing an extra parameter to get()/put()/Query.fetch() to disable it would work. Any thoughts? It kinda sucks that user code needs to handle these exceptions when the only real sane thing it can do is retry the operation. As always, I'm probably missing something obvious. :) Thanks, David. -- It is better to be wrong than to be vague. — Freeman Dyson --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
