Closed Bug 1051826 Opened 11 years ago Closed 11 years ago

double-check tidings task ratelimits

Categories

(support.mozilla.org :: Code Quality, task, P1)

Tracking

(Not tracked)

RESOLVED FIXED
2014Q3

People

(Reporter: willkg, Assigned: rrosario)

Details

(Whiteboard: u=dev c=infra p=1 s=2014.15)

There's a tidings task that seems to spawn more often than 1/m, but it has a ratelimit of 1/m which means we're piling these tasks up. This bug covers: 1. figuring out what is creating those tasks and making that match the ratelimit 2. (or) ditching the task altogether and turning it into a cron job that runs every 10 minutes or something like that
Adding to next sprint too. Guessing at 2pts.
Priority: -- → P1
Whiteboard: u=dev c=infra p=2 s=2014.15
Target Milestone: --- → 2014Q3
What about removing the ratelimit altogether? I assume this was about not hitting the mail server too often, but they should be able to handle us. They are web scale.
reducing to 1pt per IRC
Whiteboard: u=dev c=infra p=2 s=2014.15 → u=dev c=infra p=1 s=2014.15
Option 2 was to ditch the task altogether and use a cron job instead. That wouldn't require a ratelimit. I haven't looked at any of the code, but it seems to me like that's the better architectural option for this anyhow.
Assignee: nobody → rrosario
The claim_watches task is called every time a new user account is activated. It goes through all anonymous watches in tidings that match the user's email address and points them to the created user. The rate limit is protecting the database (I guesss? there is nothing else) but that query looks pretty simple. I think we should just remove the rate limit since accounts aren't really created that often anyway. A few hundred per day at worst. We shouldn't really hit this limit ever anyway unless the queues are clogged up. I am almost tempted to just leave it. Hmmm
I'd change this from creating a task every time we activate a new user account to kicking off a cron job every 10 minutes that does the work. Less celery = more sanity.
(In reply to Will Kahn-Greene [:willkg] from comment #6) > I'd change this from creating a task every time we activate a new user > account to kicking off a cron job every 10 minutes that does the work. That's good but I'm not exactly sure how we would know which users we are doing this for without creating a another queue? Another option is simply to do that right in the request context and be done. I guess we can verify that the query isn't crazy slow.
Oh, whoops. I didn't read the code very well. My bad. Yeah, now that I've re-read the code, I agree: either leave it as is or nix the ratelimit. Sorry about that!
The rate limit was removed from the task in django-tidings: https://github.com/erikrose/django-tidings/commit/60da8179bc3b61a3fc41b4487730bda674a4a8ee The pull request to update django-tidings in kitsune is here: https://github.com/mozilla/kitsune/pull/2078
Deployed to prod.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.