[hmm, this question didn't attract any interest on StackOverflow..., thought I'd give it a try here]
I'm looking to add some defensive exception handling/retry logic around my (Java) code that enqueues tasks in App Engine. In reviewing the documentation for potential exceptions raised, I see several candidates that might make sense to catch and handle with a retry, but the documentation is a bit vague, so I thought I'd see what others have found to be worthwhile.
Here are the ones I'm looking at, and their descriptions from the docs:
The only one for which the docs explicitly suggest that retrying might be helpful is TransientFailureException.
Also, regarding TransactionalTaskException, is this something that would only arise when enlisting a task in an enclosing datastore transaction, or could this arise when enqueuing a standalone task?
Actually, in Python we have a great deal more exceptions. I've got a
list of exceptions similar to yours that I retry. These also include
deadline exceeded and timeout errors.
Robert
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/JV4cR4o2BNYJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
case TASK_ALREADY_EXISTS:return new TaskAlreadyExistsException("Task name already exists : " + detail); case TOMBSTONED_TASK: return new TaskAlreadyExistsException("Task name is tombstoned : " + detail);
The same file also shows that QueueFailureException is basically a generic catch-all for anything not handled explicitly:
So that seems worth a retry if it pops up.default: return new QueueFailureException("Unspecified error (" + errorCode + ") : " + detail);
I'm not sure about the transactional error. I do not think I have
ever seen one.
Robert
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/60AaEXo1XrQJ.