> I don't think you can do this. When you get a DeadlineExceededError
> you only have a very short amount of cpu time left -- enough to return
> a simple response to the client, but not enough to queue a new task.

http://code.google.com/appengine/articles/deferred.html contains
sample code that defers a task in response to a
DeadlineExceededError .

Note that this example is not a "big" task, one that would cause the
deferred code to generate a model instance containing the data.  It's
one that fits in the task queue's size limit (IIRC, 10k).

On Dec 12, 4:23 am, Stephen <sdea...@gmail.com> wrote:
> On Dec 10, 11:44 am, Alex Popescu
>
> <the.mindstorm.mailingl...@gmail.com> wrote:
>
> > Here is the scenario in which I'm seeing this error:
>
> > - I have a set of tasks that are executed
>
> > - the tasks are expensive so sometimes they may reach the
> > DeadlineExceededError
>
> > - in case the DeadlineExceededError occurs, I am attempting to create
> > a new task to signal that processing was not completed and should
> > continue at a later moment
>
> I don't think you can do this. When you get a DeadlineExceededError
> you only have a very short amount of cpu time left -- enough to return
> a simple response to the client, but not enough to queue a new task.
>
> > While I could probably code around this issue, it will definitely make
> > my app code more messy and complex. Right now things are clear:
>
> > - there is a list of objects that must be processed
>
> > - once new objects get appended to that list a new task is created for
> > taking care of them
>
> > - if the task cannot empty the list of objects to be processed it is
> > scheduling a new task to continue the processing later
>
> You could try making your batch size smaller.
>
> If a task does not return a 200 success response, it will be retried.
> You could code your task so that if it only manages to process some of
> the list, when it is run again after returning a non-200 response it
> picks up where it left off and processes the remaining items in the
> list.
>
> > Can anyone explain the meaning of the CancelledError? I read the
> > documentation and I must confess that I'm not very sure what triggers
> > it (at least I don't agree it is "explicitly").
>
> This is probably your second task being cancelled after your
> DeadlineExceededError.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to