Ensure PPA page only requests next update when previous is received successfully
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Michael Nelson |
Bug Description
The original ppa build updater used a JS setInterval() statement to ensure the builds were updated every minute, but this lead to a backlog of update requests when many people have public ppa pages open (see bug 370189).
Maris applied a temporary fix to use setTimout() instead, so that the request will only be made once.
As part of a longer term solution, we could:
1. ensure that the next setTimout() is set only after the previous update is received, and possibly
2. Apply a simple binary exponential for the timeout, ie. along the lines of:
{{{
MAX_PERMISSIBLE
MIN_TIMEOUT = 60000;
timeout = min_timeout
// When a successful response comes back for a request:
if total_time_taken > MAX_PERMISSIBLE
timeout *= 2
else if total_time_taken < GOOD_PERFORMANC
if timeout / 2 > MIN_TIMEOUT
timeout = timeout / 2
setTimeout(timeout, etc.)
}}}
This might be something we could later generalise for other polling queries.
There are a number of other improvements that could be made too (such as moving the evaluation of whether to stop polling from after the first request to before the first request is even issued.).
Changed in soyuz: | |
status: | Triaged → In Progress |
Changed in soyuz: | |
status: | Fix Committed → Fix Released |
r8385