celery/celery — pull request #2358 by mpermana (2014-11-07 01:38:50+00:00)
Title: https://github.com/celery/celery/issues/2357

I debugged through the code and found the root cause is because

the bucket in strategy.py default's function was initialized only in the beginning of the function

When we call celery control rate_limit proj.tasks.mul 60/m
The code goes to consumer.py and calls reset_rate_limits which reset the buckets in consumer.task_buckets. However strategy.py bucket variable is still referencing the old one, so the rate limit never take effect.

I am forking a repo to make fix for this. I just move the bucket assignment just before the if check so it always get the latest bucket.

Please review them, and if you like deliver them to master / 3.x releases.