Merge lp:~gmb/launchpad/bugwatch-next_check-bug-544238 into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Graham Binns on 2010-03-23 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~gmb/launchpad/bugwatch-next_check-bug-544238 | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
215 lines (+113/-8) 5 files modified
database/schema/comments.sql (+1/-0) database/schema/patch-2207-42-0.sql (+7/-0) lib/lp/bugs/doc/bug-watch-activity.txt (+83/-0) lib/lp/bugs/model/bugwatch.py (+6/-3) lib/lp/bugs/scripts/checkwatches.py (+16/-5) |
||||
| To merge this branch: | bzr merge lp:~gmb/launchpad/bugwatch-next_check-bug-544238 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jonathan Lange (community) | db | 2010-03-22 | Abstain on 2010-03-23 |
| Björn Tillenius (community) | db | 2010-03-22 | Approve on 2010-03-23 |
| Stuart Bishop | db | 2010-03-22 | Approve on 2010-03-23 |
|
Review via email:
|
|||
Commit Message
Add a next_check column to BugWatch.
Description of the Change
This branch adds a next_check field to BugWatch. We'll use this to allow us to throttle BugWatch updates where the BugWatch is continually failing.
| Graham Binns (gmb) wrote : | # |
| Jonathan Lange (jml) wrote : | # |
Why aren't you using the Job table for this?
Even if you don't, consider calling the column 'scheduled_start' to at least be vaguely consistent.
| Graham Binns (gmb) wrote : | # |
On 22 March 2010 16:10, Jonathan Lange <email address hidden> wrote:
> Why aren't you using the Job table for this?
>
Is there a reason to use the Job table? We decided last week that
checkwatches shouldn't use the Jobs system; it doesn't fit the needs
of our batched processing model particularly well and any such
solution would be a kludge.
I'll happily rename the field, though.
| Jonathan Lange (jml) wrote : | # |
On Mon, Mar 22, 2010 at 4:15 PM, Graham Binns <email address hidden> wrote:
> On 22 March 2010 16:10, Jonathan Lange <email address hidden> wrote:
>> Why aren't you using the Job table for this?
>>
>
> Is there a reason to use the Job table? We decided last week that
> checkwatches shouldn't use the Jobs system; it doesn't fit the needs
> of our batched processing model particularly well and any such
> solution would be a kludge.
>
Oh right, I saw that decision mentioned on a bug report last week but
didn't see anything about the reasoning behind it. I'm surprised that
a system which bears such a strong resemblance to code imports
requires a significantly different model. Perhaps the resemblance is
only superficial.
> I'll happily rename the field, though.
Thanks. You might want to hold off until stub & Bjorn have their say though.
jml
| Graham Binns (gmb) wrote : | # |
On 22 March 2010 16:21, Jonathan Lange <email address hidden> wrote:
> Oh right, I saw that decision mentioned on a bug report last week but
> didn't see anything about the reasoning behind it. I'm surprised that
> a system which bears such a strong resemblance to code imports
> requires a significantly different model. Perhaps the resemblance is
> only superficial.
We thought the same thing to, but BugWatch is significantly different
in that it loads a lot of data from a bug tracker up front and then
does bug watch updates based on the cached data. Using the Jobs model
would mean that we wouldn't (easily) have that cache, which in turn
means that we'd be hitting bug trackers for data a lot more than we do
now. That's okay for Bugzilla 3.4 or 3.2 + plugin, where we can ask
for only what we need, but for older bugtrackers we ask for all the
data and then parse it, because there's no other option.
>> I'll happily rename the field, though.
>
> Thanks. You might want to hold off until stub & Bjorn have their say though.
>
Okay.
--
Graham Binns | PGP Key: EC66FA7D
| Stuart Bishop (stub) wrote : | # |
Fine. patch-2207-42-0.sql
I'm happy with 'next_check' as a column name. This is a repeating job. Jobs in the Jobs table run once and have a scheduled_start, date_started and date_finished timestamp.
| Björn Tillenius (bjornt) wrote : | # |
< BjornT> gmb: sure, i'll look at it, if you explain how it will be used.
in more detail :)
< gmb> BjornT: Cool. So, we want to be a bit more sensible with.
scheduling bug watch checks. At the moment we check each watch.
once every 24 hours, but if it's erroring a lot (which we now.
record in the BugWatchActivity table) we don't want to check it so.
often.
< gmb> BjornT: So, instead of building that logic into.
best, we think we should have a garbo-hourly process that looks at.
all the bug watches checked in the last hour, checks to see how.
often they've errored and then schedules their next_check.
accordingly.
< gmb> So BugTracker.
next_check field instead of lastchecked to determine whether a.
watch needs checking.
< gmb> The advantage is that we don't have to further complicate.
checkwatches to get the back-off for erroring watches.
< BjornT> gmb: ok, that makes sense. i'm wondering if we could find a.
better name? if you set next_check to some time, it doesn't.
mean that it will be checked exactly at that time, will it?
< gmb> BjornT: Hmm, true. How about check_after?
< stub> check_due ?
* stub gets out his bike shed schematics
< gmb> It should be blue.
< BjornT> gmb: maybe next_check is good, as long as there is a comment.
think next_check is better than the other suggestions.
< gmb> BjornT: Right; I'll add the comment (should've added it anyway).

Argh. I've forgotten to add the prerequisite branch to this one. Here's the actual diff for this branch:
=== added file 'database/ schema/ patch-2207- 99-0.sql' schema/ patch-2207- 99-0.sql 1970-01-01 00:00:00 +0000 schema/ patch-2207- 99-0.sql 2010-03-22 15:58:29 +0000 min_messages= ERROR; 'UTC':: text, now()); _next_check_ _idx ON BugWatch( next_check) ; seRevision VALUES (2207, 99, 0);
--- database/
+++ database/
@@ -0,0 +1,7 @@
+SET client_
+
+ALTER TABLE BugWatch ADD COLUMN next_check timestamp without time zone DEFAULT timezone(
+
+CREATE INDEX bugwatch_
+
+INSERT INTO LaunchpadDataba