Ensure PPA page only requests next update when previous is received successfully

Bug #371556 reported by Michael Nelson
8
This bug affects 1 person
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_REQUEST_TIME = 5000;
MIN_TIMEOUT = 60000;

timeout = min_timeout

// When a successful response comes back for a request:
if total_time_taken > MAX_PERMISSIBLE_REQUEST_TIME:
    timeout *= 2
else if total_time_taken < GOOD_PERFORMANCE_REQUEST_TIME:
    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.).

Tags: lp-soyuz ppa ui
Changed in soyuz:
status: Triaged → In Progress
Revision history for this message
Michael Nelson (michael.nelson) wrote :

r8385

Changed in soyuz:
status: In Progress → Fix Committed
Changed in soyuz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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