checkwatches hammers the remote server when asking for changed bugs

Bug #506158 reported by Michael Barnett
40
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Gavin Panella

Bug Description

What happens:
When checkwatches runs it asks the remote server for a list of the bugs that have been updated since a given date (usually the oldest lastchecked date for the current bugwatch set). It does this blindly and doesn't take into account the number of remote bugs its asking about. In the case of gnome-bugs, it was asking about over 13,000 bugs and sending a 52MB POST request to the remote system in order to do so, bringing bugzilla.gnome.org to its knees.

See lib/lp/bugs/scripts/checkwatches.py:584 for the offending code

What should happen:
checkwatches should be aware of the number of remote bugs its asking about and ensure that it's not an unreasonable number (we could use the current batch size as a guideline, for example).

Tags: lp-bugs

Related branches

Changed in launchpad:
status: New → Invalid
status: Invalid → New
importance: Undecided → High
Curtis Hovey (sinzui)
affects: launchpad → malone
Changed in malone:
status: New → Triaged
milestone: none → 10.01
Curtis Hovey (sinzui)
Changed in malone:
assignee: nobody → Graham Binns (gmb)
Revision history for this message
Graham Binns (gmb) wrote :

Do we have any evidence that sites other than gnome-bugs are affected or unaffected? If not then we should just assume that all sites are affected.

Graham Binns (gmb)
summary: - checkwatches being abusive towards external sites
+ checkwatches hammers the remote server when asking for changed bugs
description: updated
description: updated
Graham Binns (gmb)
Changed in malone:
assignee: Graham Binns (gmb) → nobody
Gavin Panella (allenap)
Changed in malone:
assignee: nobody → Gavin Panella (allenap)
Gavin Panella (allenap)
Changed in malone:
status: Triaged → In Progress
Revision history for this message
Gavin Panella (allenap) wrote :

In the course of doing QA on staging, it seems that there are *two* huge POSTs going on. The second has been fixed by lp:~allenap/launchpad/stop-checkwatches-hammering-bug-506158, but the first has not:

BugWatchUpdater._updateBugTracker() calls _getExternalBugTrackersAndWatches(), passing in a result set of *every* out-of-date bug watch for a given bug tracker. This is used to construct a list of remote bug IDs which are passed to the remote system by way of BugzillaAPI.getProductsForRemoteBugs().

Revision history for this message
Graham Binns (gmb) wrote :

That's irritating.

Maybe I was right the other day and we should make ExternalBugTrackers a little bit smarter and prevent them from allowing checkwatches to do stupid things like this.

How we'd do it in a way that doesn't mean touching every EBT class, I don't know.

Gavin Panella (allenap)
Changed in malone:
status: In Progress → Fix Committed
Revision history for this message
Gavin Panella (allenap) wrote :

The linked stop-checkwatches-hammering-bug-506158{,-devel} branches fix the bug originally described in this branch. The stop-checkwatches-hammering-products-bug-506158{,-devel} branches do *not* fix the additional bug described in comment #2, but are a good workaround for now. Work to fix the batching problem in a more complete way is being tracked in bug 509223.

Gavin Panella (allenap)
Changed in malone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.