New issue
Advanced search Search tips

Issue 684425 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Can't download more than 50 files simultaneously

Reported by alshaba...@yandex-team.ru, Jan 24 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.77 YaBrowser/17.1.0.1289 (beta) Yowser/2.5 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Make sure website has "Automatic downloads" setting set to Ask
2. Make website trigger 60 simultaneous downloads
3. Permission prompt to allow multiple downloads is shown
4. Click Allow.

What is the expected behavior?
All files eventually are downloaded. Or there's some UI allowing you to continue downloading files after each batch of 50 files.

What went wrong?
Some files won't be downloaded. Consequently, with DCHECKs turned on, quitting the browser will trigger `DCHECK(callbacks_.empty());` in `DownloadRequestLimiter::TabDownloadState::~TabDownloadState`.

Did this work before? N/A 

Chrome version: 55.0.2883.77  Channel: n/a
OS Version: OS X 10.12.2
Flash Version: Shockwave Flash 24.0 r0

The ticket is created as a response to https://codereview.chromium.org/2561673003/#msg12

I experimented using the following page:
<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">

// From https://permission.site
function triggerDownload() {
  // Based on http://stackoverflow.com/a/27280611
  var a = document.createElement('a');
  a.download = "test-image.png";
  a.href = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAABC0lEQVQYlTXPPUsCYQDA8b/e04tdQR5ZBpE3NAR6S0SDVDZKDQ2BY9TUy1foE0TQ1Edo6hOEkyUG0QuBRtQgl0hnenVdnZD5eLbU7xv8Avy5X16KhrQBg47EtpziXO6qBhAEeNEm0qr7VdBcLxt2mlnNbhVu0NMAgdj1wvjOoX2xdSt0L7MGgx2GGid8yLrJvJMUkbKfOF8N68bUIqcz2wQR7GUcYvJIr1dFQijvkh89xGV6BPPMwvMF/nQXJMgWiM+KLPX2tc0HNa/HUxDv2owpx7xV+023Hiwpdt7yhmcjj9/NdrIhn8LrPVmotctWVd01Nt27wH9T3YhHU5O+sT/6SuVZKa4cNGoAv/ZMas7pC/KaAAAAAElFTkSuQmCC";
  a.click();
}

function triggerMultipleDownloads() {
  for (i = 0; i < 60; i++) {
    triggerDownload();
  }
}

</script>

<button onclick="triggerMultipleDownloads()">Multiple downloads</button>

</body>
</html>

This throttling was introduced in  https://crbug.com/39277  to avoid crashes.
 
Also, when "Automatic downloads" setting is set to Allow, all 60 downloads will be downloaded. Unless I am missing something, no limiting is actually done by DownloadRequestLimiter in this case: on 50th download it'll enter PROMPT state; next download will check content setting, see, that it's Allow, re-enter ALLOW_ALL state and will allow this download.
Labels: Needs-Milestone
Components: -Internals>Network UI>Browser>Downloads
Sounds more likely a Download issue, assigning to Downloads. Feel free to add Network back if it's believed to be a network issue.

Comment 4 by tapted@chromium.org, Jan 25 2017

Cc: dominickn@chromium.org
Components: UI>Browser>Permissions
Labels: -OS-Mac OS-All
[mac triage] this isn't mac specific.

(also, IMO, seems like any approach here could be abused -- better that websites simply don't try. I'd say it's fine to drop the rest on the floor).
Labels: Needs-Triage-M58

Comment 6 by ajha@chromium.org, Feb 3 2017

Cc: ajha@chromium.org
Labels: -Needs-Milestone -Needs-Triage-M58 M-58
Status: Untriaged (was: Unconfirmed)
I am able to reproduce the issue on the latest canary(58.0.30001.0) and the latest stable(56.0.2924.87) on Windows-10, Mac OS 10.12.2 and Linux Ubuntu 14.04.

This is non-regression issue as same behavior is seen on older chrome version: 30.0.1549.0 as well. Unable to download files>50. Attached is the test file as per C#0.

Marking this as Untriaged for more inputs on this.
684425.html
955 bytes View Download

Comment 7 by dah...@chromium.org, Feb 23 2017

Labels: -Pri-2 Needs-Feedback Pri-3
alshabalin@ Can you tell me more about the desired use case here? It seems like wanting to initiate 51+ downloads simultaneously is a pretty extreme edge case and the potential for abuse is high.  
I agree that it's an edge case and that in reality downloading more than 50 files simultaneously can cause problems. However, the issue I see here is: there's no indication for the user that Chrome has ignored some download requests.
Labels: -M-58 M-59
Owner: qin...@chromium.org
Status: Assigned (was: Untriaged)
- The DCHECK failure is disconcerting.
- Maybe a "X downloads failed" message would be useful as well.
- In the future queuing these makes sense, but somewhat low priority in the short term.

+qinmin@ to look into the DCHECK.

Sign in to add a comment