Issue metadata
Sign in to add a comment
|
Failure to Download a File after Pausing
Reported by
masonlev...@gmail.com,
Apr 14 2017
|
||||||||||||||||||||||||
Issue descriptionDevice name: Pixel From "Settings > About Chrome" Application version: 57.0.2987.132 Operating system: Android 7.1.2; Pixel Build/N2G47E URLs (if applicable): http://www.thinkbroadband.com/download.html Steps to reproduce: (1) Go to specified URL (2) Long press red "1GB (v. large)" box (3) Press "Download link" in the context menu that was brought up from the long press (4) Press menu and then Downloads (5) Pause the download (6) Wait for at least 30 seconds (7) Resume the download Expected result: Download would resume and successfully download the entire 1GB zip Actual result: The download seems to resume, but then completes obviously too quick and the final file size is much less than 1GB
,
Apr 15 2017
We are not able to access this url - http://www.thinkbroadband.com/download.html Can you provide the URLs of some sites on which you experience this issue? other than this url -http://www.thinkbroadband.com/download.html? This will help us reproduce what you are seeing.
,
Apr 15 2017
I believe the download failure will happen with any download. Just find a file large enough so you have time to pause the download before it completes.
,
Apr 15 2017
Thank you for providing more feedback. Adding requester "kravula@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 17 2017
I am able to repro with large files.
,
Apr 17 2017
this also reproduces on linux desktop
,
Apr 17 2017
I think waiting for 30 seconds probably closes the connection. And that causes reading from the socket to end prematurely. The url request log indicates that the download failed with ERR_CONTENT_LENGTH_MISMATCH, somehow we still rename the file and treat it as if it completes. Will look into this.
,
Apr 17 2017
ok, in HttpStreamParser::DoReadBodyComplete(), we have this comment: // - If a Content-Length header is present and the body contains fewer bytes // than promised by the header at connection close, it may indicate that // the connection was closed prematurely, or it may indicate that the // server sent an invalid Content-Length header. Unfortunately, the invalid // Content-Length header case does occur in practice and other browsers are // tolerant of it. We choose to treat it as an error for now, but the // download system treats it as a non-error, and URLRequestHttpJob also // treats it as OK if the Content-Length is the post-decoded body content // length.
,
Apr 17 2017
This is curretly expected as pause() always leave the connection open. If server closes the connection before resume() is called, then we end up with this situation. Chrome cannot differentiate whether the connection was closed or whether the content-length header is incorrect. One possible solution is to always cancel the request when pause() is called, and then resend a new request on resumption. That will create a new connection, but it will also introduce re-download issues if content-length is not present.
,
Apr 17 2017
correct myself: the last sentence should be "re-download issues if strong validators are not present"
,
Apr 17 2017
Asanka@, any thoughts on this? pausing a download for more than 30 seconds seems common. But if the connection is closed, then the download will end in a wrong size.
,
Apr 17 2017
This is the same as issue 453357 . The underlying cause and possible remediations are discussed briefly there.
,
Apr 17 2017
Interesting, we have some code to handle ERR_CONTENT_LENGTH_MISMATCH in download_request_core, does it make sense to add more logic to let the download system know, that we're in this situation and we may create a new connection when Resume() is called after a Pause(). But if there is no strong validators, I guess we shouldn't resume with a new connection. Also, even if the download system knows it, we still have the edge case(very rare) that the connection is actually being closed and the user pause, at this point it's hard to tell if a new connection is needed. +asanka into cc list.
,
Apr 17 2017
I think we can send a new range request if we found that the downloaded content size mismatches with the content-length, before completing the download
,
Apr 18 2017
I'd suggest duping this into issue 453357 and continuing there. The suggested approach is to treat ERR_CONTENT_LENGTH_MISMATCH as an error, map it to a corresponding interrupt reason, and allow that interrupt to resume automatically. We'd end up with an interrupted download if the there were no strong validators. In that case, users may lose data they would've previously been able to access. This is a case which we'll need to look into further. One option is to condition the behavior based on whether the response is byte addressible, and only consider it an error in that case. Either way there's no need to keep two bugs open for this.
,
Apr 19 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by candr...@chromium.org
, Apr 14 2017Components: UI>Browser>Downloads
Labels: triage-te