pmclanahan / django-celery-email

A Django email backend that uses a celery task for sending the email.
BSD 3-Clause "New" or "Revised" License
477 stars 108 forks source link

rate_limit task setting will discard tasks if exceeded #1

Closed kimsterv closed 12 years ago

kimsterv commented 12 years ago

I know it's not a required setting, but it appears as though celery will just discard the tasks if this rate_limit is exceeded. In other words, if this is set, and you're exceeded the rate_limit sending emails, the emails will just get discarded which is probably not the behavior you intended.

Please correct me if I'm wrong.

pmclanahan commented 12 years ago

This is definitely not the behavior I intended. This sounds like a celery bug. Do you know if it's reported, or fixed in a later version or something? I'm fairly positive that this is not how it's supposed to work.

kimsterv commented 12 years ago

I don't think it's a bug. The documentation is a little unclear for rate_limit (http://docs.celeryproject.org/en/latest/userguide/tasks.html?highlight=rate_limit#Task.rate_limit), but I found this thread on StackOverflow: http://stackoverflow.com/questions/7541931/how-is-rate-limit-enforced-in-celery. I haven't been able to dig into the code, and also don't understand how the scheduler works yet.

pmclanahan commented 12 years ago

I talked to ask (celery author) on IRC and he said that this is absolutely not the case. The person on stack overflow is very wrong. Ask also added that the token bucket algorithm that the person mentioned doesn't necessarily mean that items are discarded.

kimsterv commented 12 years ago

Thanks so much for looking into this! I see the correct response now on Stack Overflow.