Open GoogleCodeExporter opened 9 years ago
s/null empty/empty entries/
Original comment by maruel@chromium.org
on 16 Oct 2009 at 5:55
Original comment by john.abd...@gmail.com
on 16 Oct 2009 at 5:57
Wow. I worry that chunking would cause timeout errors, so I think we should
bite the
bullet and use the task queue. Can someone come up with a patch?
Original comment by gvanrossum@gmail.com
on 16 Oct 2009 at 6:00
Don't tasks have the same timeout as normal requests? In which case, we'd have
to loop
through all the datastore items to find out how many there are, in order to
know if we
need tasks, or even multiple ones, right? If so, I thought that iterating
itself is a
slow operation, so we can still have timeouts.
Original comment by john.abd...@gmail.com
on 16 Oct 2009 at 6:07
You can throw a task only when needed by catching BadRequestError and Timeout.
Original comment by maruel@chromium.org
on 16 Oct 2009 at 6:11
Tasks are retried if they fail. So the task could repeatedly try to delete the
first
500 (or fewer -- maybe the first 100) entries of the query results until the
tbd
array is empty or until an exception happens. I'm thinking of something like
while True:
tbd = <queries go here>
db.delete(tbd[:100])
del tbd[100:]
if not tbd:
break
Tasks are cheap, so there's no reason to only create a task if the tbd list is
big.
With some cleverness we could delete the Issue in the main event (so it appears
to be
deleted from the user's POV) and then create a task that deletes all its
descendants.
These days you can even do a Kind-less keys-only query for all descendants from
a
given Key.
Original comment by gvanrossum@gmail.com
on 16 Oct 2009 at 6:17
I am facing this issue now since my application provides users the ability to
delete thousands of records in one click of a button. While tasks are cheap
now, they still add up to CPU quota limits. Whats the best way to deal with
this?
Original comment by jaiswal....@gmail.com
on 14 Jun 2010 at 6:16
Original comment by albrecht.andi
on 6 Apr 2012 at 6:31
Original issue reported on code.google.com by
maruel@chromium.org
on 16 Oct 2009 at 5:54