Task retry is very useful and desirable feature; however, if you
blindly insert continuation or fan-out tasks without somehow making
sure you've not already inserted those tasks you'll get a fork bomb
(http://en.wikipedia.org/wiki/Fork_bomb).  Naming tasks is an easy way
to prevent inserting the same task over and over, should there be an
error in one your tasks.


As an example, just think about what would happen if you had the following:

class ForkBomber(webapp.RequestHandler):
  def post(self):
     taskqueue.add(url='/fork')
     raise Exception('boom')

application = webapp.WSGIApplication([('/fork', ForkBomber),]))


If you name the tasks, they will still fail and keep retrying, but you
won't get the same forking behavior.  (You'll want to catch
TaskAlreadyExistsError and TombstonedTaskError errors if you name the
tasks.)


Robert



On Sun, Mar 13, 2011 at 09:46, Matija <[email protected]> wrote:
> Wait !!! Can somebody explain me that 'fork bomb'. We are designing out
> tasks so that if any exception is thrown it's retried execution is desired
> and safe. Why is this approach wrong ? Did we miss something ?
>
> --
> 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.
>

-- 
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.

Reply via email to