ibolmo / cametrics

A RESTful logging system for Campaign Metrics

Home Page:http://cametrics.appspot.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on DELETE campaign with many entries

ibolmo opened this issue · comments

Exception in request:
Traceback (most recent call last):
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/zip-packages/django-1.0.2.zip/django/core/handlers/base.py", line 86, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/zip-packages/django-1.0.2.zip/django/contrib/auth/decorators.py", line 67, in __call__
    return self.view_func(request, *args, **kwargs)
  File "/base/data/home/apps/cametrics/1.333614277205847806/myapp/views.py", line 104, in delete_campaign
    post_delete_redirect=reverse('myapp.views.list_campaigns'))
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/zip-packages/django-1.0.2.zip/django/views/generic/create_update.py", line 222, in delete_object
    obj.delete()
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/appenginepatch/appenginepatcher/patch.py", line 440, in delete
    signals.pre_delete.send(sender=self.__class__, instance=self)
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/zip-packages/django-1.0.2.zip/django/dispatch/dispatcher.py", line 148, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/appenginepatch/ragendja/dbutils.py", line 426, in cleanup_relations
    rels_seen, to_delete, to_put = get_cleanup_entities(instance)
  File "/base/data/home/apps/cametrics/1.333614277205847806/common/appenginepatch/ragendja/dbutils.py", line 382, in get_cleanup_entities
    raise Exception("Can't delete so many entities at once!")
Exception: Can't delete so many entities at once!

The utility function used for deleting prevents deleting more than 100 entities at one time. This is due that deletes take a long time in BigTable. Eventually we'd hit the 30 sec timeout.

Instead a solution is to delete the campaign entity and clean up the rest of the data (storage, statistics, and histograms) using a scheduled task.