Opened 8 months ago

Closed 8 months ago

#29180 closed defect (fixed)

MAR download stalls when about dialog is opened

Reported by: mcs Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: TorBrowserTeam201902R, tbb-update
Cc: Actual Points:
Parent ID: #25694 Points:
Reviewer: Sponsor:

Description

In #28885, Georg encountered a bug that causes the browser update to stall. Here are the steps that Kathy and I used to reproduce it:

  1. Start a clean copy of Tor Browser 8.5a5 on a 64-bit Linux system.
  2. Set app.update.auto to false and app.update.log to true.
  3. Open the about dialog and click "Update to 8.5a6" to begin downloading the MAR file.
  4. Quickly close and reopen the about dialog. The download will stall and not make any further progress.

The following was logged to the browser console:

AUS:SVC UpdateService:downloadUpdate - no support for downloading more than one update at a time

This problem is fallout from the fact that when the about dialog is opened, the browser cancels the download and starts a new one. Here is the code from the startDownload() function inside browser/base/content/aboutDialog-appUpdater.js:

...
this.aus.pauseDownload();
let state = this.aus.downloadUpdate(this.update, false);
...

Looking at the code in toolkit/mozapps/update/nsUpdateService.js, we see that pauseDownload() cancels the first download via nsIRequest.cancel(), which does not take effect immediately. Cleanup of the Downloader occurs inside an onStopRequest() listener and that entire process is asynchronous.

One possible fix is to not pause and restart the download when the about dialog is opened. Kathy and I do not yet know if that would introduce other problems.

Child Tickets

Change History (6)

comment:1 Changed 8 months ago by mcs

Parent ID: #25694

comment:2 Changed 8 months ago by mcs

Keywords: TorBrowserTeam201901R added
Status: newneeds_review

comment:3 Changed 8 months ago by gk

Keywords: tbb-updater added

comment:4 Changed 8 months ago by gk

Keywords: TorBrowserTeam201902R added; TorBrowserTeam201901R removed

Moving our review tickets to February.

comment:5 Changed 8 months ago by gk

Keywords: tbb-update added; tbb-updater removed

Renaming keyword to make it a bit broader

comment:6 Changed 8 months ago by gk

Resolution: fixed
Status: needs_reviewclosed

Looks good. I cherry-picked the patch to tor-browser-60.5.0esr-8.5-1 (commit ffda294141584fdf69257e2a04fbcc7d4705ca3f).

Note: See TracTickets for help on using tickets.