akvo / akvo-rsr

Akvo Really Simple Reporting
http://rsr.akvo.org
GNU Affero General Public License v3.0
39 stars 20 forks source link

Bug: slow django-q schedules saturate the queue and are run multiple times #5249

Closed MichaelAkvo closed 1 year ago

MichaelAkvo commented 1 year ago

What were you doing?

Specifically result framework aggregations can take longer than a minute (which is the frequency of the schedule). That leads to:

What should've happened?

When the aggregation task is running, any renewed attempts to run it should just end.

My environment

No response

Additional context

https://github.com/Koed00/django-q/blob/master/django_q/cluster.py#L660

django-q doesn't check if a scheduled task is already queued or running before scheduling it