Closed Bug 349809 Opened 18 years ago Closed 18 years ago

add random intervals to update requests

Categories

(Toolkit :: Safe Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2

People

(Reporter: tony, Assigned: tony)

References

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 2 obsolete files)

(another requirement from launch engineering)

If anti-phishing is on, we make an update request for local lists when Firefox starts up and then once every hour.  Rather than having a rigid time, we should add a small random interval (e.g., 60 min + (rand() * 5 min)).  This avoids the case of everyone hitting the server at exactly the same time.
Flags: blocking-firefox2?
I don't know if this proposal actually solves that problem, but sure, we'll take a small timer fix here :)
Flags: blocking-firefox2? → blocking-firefox2+
Target Milestone: --- → Firefox 2
Instead of adding up to five minutes of randomness, it seems like it'd sense to pick a random number between 0 and 59 each time a user starts up and then start updating on that minute every hour.  Then we'll be distributing loads evenly across the minutes in the hour, regardless of the distribution of starts across them.

So, after checking for the first time on startup, check for the second time in
30 + (rand() * 59) minutes, which distributes the second check between 30 and 89 minutes (an average of one hour) away.  Then commence checking every 60 minutes.
Flags: blocking-firefox2+ → blocking-firefox2?
Target Milestone: Firefox 2 → ---
(In reply to comment #2)
> Instead of adding up to five minutes of randomness, it seems like it'd sense to
> pick a random number between 0 and 59 each time a user starts up and then start
> updating on that minute every hour.  Then we'll be distributing loads evenly
> across the minutes in the hour, regardless of the distribution of starts across
> them.
> 
> So, after checking for the first time on startup, check for the second time in
> 30 + (rand() * 59) minutes, which distributes the second check between 30 and
> 89 minutes (an average of one hour) away.  Then commence checking every 60
> minutes.

This sounds better and shouldn't be riskier to implement.  I'll go with this.
Err, the blocking flag accidentally got toggled off.
Flags: blocking-firefox2? → blocking-firefox2+
Target Milestone: --- → Firefox 2
- going with myk's suggestion
Attachment #235270 - Flags: review?(provos)
Comment on attachment 235270 [details] [diff] [review]
v1: add random interval to table update requests

I am a little bit confused about the use of repeating alarms here.  at the moment, initialUpdateCheck is called for each update and it installs a repeating alarm.  wouldn't it be cleaner to make that a non repeating alarm or call initialUpdateCheck only once and then go back to the CheckForUpdates function?
(In reply to comment #6)
> (From update of attachment 235270 [details] [diff] [review] [edit])
> I am a little bit confused about the use of repeating alarms here.  at the
> moment, initialUpdateCheck is called for each update and it installs a
> repeating alarm.  wouldn't it be cleaner to make that a non repeating alarm or
> call initialUpdateCheck only once and then go back to the CheckForUpdates
> function?

It does your second suggestion of calling initialUpdateCheck only once then going back to checkForUpdates.  Perhaps the comments are confusing?
Comment on attachment 235270 [details] [diff] [review]
v1: add random interval to table update requests

looks fine.  i must have misread earlier.
Attachment #235270 - Flags: review?(provos) → review+
Attachment #235270 - Flags: superreview?(darin)
Offline, Niels said it should be 30 minutes.  Same as before except first scheduled check is between 15-45 min, then every 30 min after that.
Attachment #235270 - Attachment is obsolete: true
Attachment #235464 - Flags: review?(provos)
Attachment #235270 - Flags: superreview?(darin)
Attachment #235464 - Attachment description: v2: switch to 30 minu update interval → v2: switch to 30 min update interval
Comment on attachment 235464 [details] [diff] [review]
v2: switch to 30 min update interval

you need to adjust some of the comments that talk about 60 minute intervals.
Attachment #235464 - Flags: review?(provos) → review+
Attached patch v3: fix commentsSplinter Review
Attachment #235464 - Attachment is obsolete: true
Attachment #235475 - Flags: superreview?(darin)
Attachment #235475 - Flags: superreview?(darin) → superreview+
on trunk
Attachment #235475 - Flags: approval1.8.1?
Comment on attachment 235475 [details] [diff] [review]
v3: fix comments

a=beltzner on behalf of 181drivers
Attachment #235475 - Flags: approval1.8.1? → approval1.8.1+
on branch
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: