Bugs/CheckwatchesNG

Not logged in - Log In / Register

Checkwatches: The Next Generation

The problem

Checkwatches is the group noun for the code that allows us to interact with remote bugtrackers (usually found in lp.bug.externalbugtracker) and the cronscript that runs that code (found in lp.bugs.scripts.checkwatches).

There are a number of problems with the current checkwatches approach:

  1. It's serial. Bug watches are checked on a per bug-tracker basis, one bug tracker after another.

  2. It's inefficient. Whilst bug watch checking is often batched (so we request a block of bugs from the remote server instead of one at a time) there's still a significant setup cost to checking each bug tracker. For example, a single check of bugzilla.gnome.org can take up to 15 seconds, and most of that isn't spent getting watches from the remote server.

  3. There can be only one. Only one instance of checkwatches.py runs at any one time. It's a cronscript that (currently) runs at 10-minute intervals. However, if one script run overruns it prevents the next one from taking place at all. The likelihood of an overrun increases as more bug trackers need watches checking. Since some trackers will always need the maximum number of watches checking at a time, overruns become very likely indeed.

  4. Error reporting sucks. At the moment, checkwatches has an OOPS report, but it's not brilliant and its difficult to separate the signal from the noise.

  5. checkwatches always checks every watch. Even if a remote bug hasn't changed status for years, checkwatches will still try to check it once every 24 hours. When a bug tracker has a lot of bug watches (gnome-bugs has 13,000 at the time of writing) this gets pretty silly.

  6. It's all CLI. You need a LOSA to do anything with checkwatches, and they need to play silly buggers with checkwatches on loganberry.

Possible solutions

Here are some possible solutions to the problems of checkwatches. These are a bit brain-dumpy at the moment (this isn't even a spec; it's a proto-spec at best, so feel free to point out nonsense should it appear in the following).

Go Parallel

In other words, do more at the same time, for example by:

Running Multiple instances

Using Twisted, or another asynchronous framework

checkwatches spends most of its time blocked doing network stuff. Twisted eats that kind of stuff with babies on the side. The externalbugtracker package would be reasonably easy to convert to use Twisted.

Don't check watches that don't need checking or can't be checked

Make it possible to control checkwatches through the UI

Provide better stats in the UI

Import everything

Bugs/CheckwatchesNG (last edited 2009-10-13 11:07:00 by allenap)