Last modified: 2014-10-27 16:08:17 UTC
Tasks should clean up after themselves when SoftTimeLimitExceeded exception is raised. If not a report (=task) will appear on the database with status STARTED when in fact will never complete, as it was cancelled (for taking too much time) This is happening right now with PagesCreated and NamespaceCreated for enwiki | 1791117 | 2014-10-21 00:00:00 | enwiki - PagesCreated | STARTED | | 1791122 | 2014-10-22 00:00:00 | enwiki - PagesCreated | STARTED | In the code we are handling properly reports left in stage "PENDING" but not started (which indicate that report could not even start really)
>Tasks should clean up after themselves when SoftTimeLimitExceeded exception is raised. Taking this back, this is already happening. Now, what is missing is exceptions raised within the STARTING or PENDING phase that are not related to tasks taking too long. Any exception should mark task as "FAILURE" so a future run of the scheduler (if recurrent) can pick it up.
We likely need to catch all db errors via catching the highest level exception on sqlalchemy exception classes at the same level where we are catching now SoftTimeLimitExceeded