Closed
Bug 395134
Opened 17 years ago
Closed 17 years ago
When resuming a download, strange things happen in the UI
Categories
(Toolkit :: Downloads API, defect)
Toolkit
Downloads API
Tracking
()
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: sdwilsh, Assigned: Mardak)
References
Details
Attachments
(1 file, 3 obsolete files)
3.83 KB,
patch
|
Details | Diff | Splinter Review |
Currently, pausing and resuming uses resumable downloads, when possible. However, this results in a crazy jump in the download speed, as well as no state when the download is paused.
This *really* needs to be fixed before we ship.
Flags: blocking-firefox3?
Reporter | ||
Updated•17 years ago
|
Flags: in-litmus?
Assignee | ||
Comment 1•17 years ago
|
||
Just incase my machine runs out of power..
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•17 years ago
|
||
Comment on attachment 279861 [details] [diff] [review]
v1
From my 1 download test, it seems to be working. Sleeping the laptop.. 3% :P
Attachment #279861 -
Flags: review?(comrade693+bmo)
Comment 3•17 years ago
|
||
http://litmus.mozilla.org/show_test.cgi?id=4577 and http://litmus.mozilla.org/show_test.cgi?id=4630 (the latter is a better stress test).
in-litmus+
Flags: in-litmus? → in-litmus+
Reporter | ||
Comment 4•17 years ago
|
||
This helps a lot, but if I pause it a second time, I get no status still.
Assignee | ||
Comment 5•17 years ago
|
||
Comment on attachment 279861 [details] [diff] [review]
v1
<sdwilsh> Mardak: r=me, but talk to mconnor if he wants it in
mconnor: This patch only fixes the insanely huge GB/sec issue, but the patch for bug 394263 should fix the blank status issue.
This could land to avoid some future bugs people will file when they try out the new download resume and see the obviously wrong download speeds.
Attachment #279861 -
Flags: review?(comrade693+bmo) → review+
Comment 6•17 years ago
|
||
Edward, you probably should request approval-1.9 on the patch so mconnor can mark his decision.
Reporter | ||
Comment 7•17 years ago
|
||
Comment on attachment 279861 [details] [diff] [review]
v1
naw, this isn't really right either.
Something is funky...
Attachment #279861 -
Flags: review+
Assignee | ||
Comment 8•17 years ago
|
||
What's funky about it?
Assignee | ||
Comment 9•17 years ago
|
||
My patch for bug 385734 will fix probably fix the blank status issue.
Assignee | ||
Comment 10•17 years ago
|
||
Apparently the ProgressChange is getting a ton of updates when resuming - basically it's starting from 0 and counting up really quickly to where it was before.
biesi: I might have been wrong thinking ProgressChange was starting at 0 because WBP was saying the resumed position is the new 0. But this makes me wonder if the download is actually resuming at the correct spot or just happens to be downloading really quickly from cache.... partial cache? Or more likely, it /is/ resuming, but how ProgressChange works, it'll start from 0 and send progress updates until it reaches it current file size? ???
This plus patch from bug 385734 has download speed and progress displaying fine in the UI without over 100 percentages and status isn't blank when pausing.
Attachment #279861 -
Attachment is obsolete: true
Attachment #280039 -
Flags: review?(comrade693+bmo)
Comment 11•17 years ago
|
||
is that with or without the patch in bug 395205?
Assignee | ||
Comment 12•17 years ago
|
||
Comment on attachment 280039 [details] [diff] [review]
v2
Oh, didn't know about bug 395205. Seems like with your patch, it /does/ restart from 0 but without massive jumps.
My patch won't work then, but the original one will likely work.. with the addition of a s/aCurTotalProgress/mCurBytes/
Attachment #280039 -
Flags: review?(comrade693+bmo) → review-
Assignee | ||
Comment 13•17 years ago
|
||
Soo... apparently aMaxTotalProgress is also based on the new request's starting position....... for HTTP requests.
biesi: Which one is right? HTTP's Max starts at <real>-<resumedPos> while FTP's Max is always <real> before and after resuming.
Attachment #280039 -
Attachment is obsolete: true
Reporter | ||
Comment 14•17 years ago
|
||
Comment on attachment 280071 [details] [diff] [review]
v3
>@@ -2110,6 +2106,11 @@ nsDownload::PauseResume(PRBool aPause)
> rv = resumableChannel->ResumeAt(fileSize, mEntityID);
> NS_ENSURE_SUCCESS(rv, rv);
>
>+ // Track where we resumed because progress notifications restart at 0
>+ mResumedAt = fileSize;
>+ mCurrBytes = 0;
>+ mMaxBytes = LL_MAXUINT;
>+
You know, I think it might be good to have an nsDownload::ResumeAt method that abstracts it out (this will help with cross session resumable downloads too so there is less logic duplication ;))
Assignee | ||
Comment 15•17 years ago
|
||
(In reply to comment #14)
> >+ // Track where we resumed because progress notifications restart at 0
> >+ mResumedAt = fileSize;
> >+ mCurrBytes = 0;
> >+ mMaxBytes = LL_MAXUINT;
> You know, I think it might be good to have an nsDownload::ResumeAt method that
> abstracts it out (this will help with cross session resumable downloads too so
> there is less logic duplication ;))
I would have thought the cross session resume would just reuse this whole function -- instead of canceling downloads at application quit, we pause them (we would only prompt the user if we have a download that we can't resume).
Comment 16•17 years ago
|
||
The current behavior of cancelling, which is to delete the intermediate file, clearly isn't going to work. So either we need to make cancel keep the intermediate and force the user to delete by hand through the OS, or pause on quit instead.
Which of these we do might depend on whether we want to automatically continue downloads on restart, or prompt.
Assignee | ||
Comment 17•17 years ago
|
||
FTP uses the SIZE request to report the max (*full* size), but progress starts at 0 when resuming.
http://mxr.mozilla.org/mozilla/source/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp#1909
// Ignore the progressMax value from the socket. We know the true size of
// the file based on the response from our SIZE request.
mChannel->OnTransportStatus(nsnull, status, progress, mFileSize);
HTTP uses the response headers to report the max (*partial* size), and progress starts at 0 when resuming.
http://mxr.mozilla.org/mozilla/source/netwerk/protocol/http/src/nsHttpChannel.cpp#4474
// mResponseHead may reference new or cached headers, but either way it
// holds our best estimate of the total content length. Even in the case
// of a byte range request, the content length stored in the cached
// response headers is what we want to use here.
nsUint64 progressMax(PRUint64(mResponseHead->ContentLength()));
Could probably hack around this in the download manager if necessary... check if MaxTotalProgress changed.. if so, we know to add ResumedAt to both curr|maxBytes.. if not, only add to currBytes.
About quitting with downloads, we can count the number of downloads that we can't resume (hopefully none these days) and let the user know how many of those there are. For the resumable ones, we just pause them and set a flag saying they were autopaused. On resume, we can resume the autopaused downloads.
Comment 18•17 years ago
|
||
please file a bug on ftp; it should do what HTTP does.
Assignee | ||
Comment 19•17 years ago
|
||
Comment on attachment 280071 [details] [diff] [review]
v3
With the patch from bug 395539, ftp transfers display correctly.
Attachment #280071 -
Flags: review?(comrade693+bmo)
Reporter | ||
Comment 20•17 years ago
|
||
Comment on attachment 280071 [details] [diff] [review]
v3
r=sdwilsh
Attachment #280071 -
Flags: review?(comrade693+bmo) → review+
Reporter | ||
Updated•17 years ago
|
Attachment #280071 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #280071 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 21•17 years ago
|
||
Bug 395207 fixed up the WBP flag.
Attachment #280071 -
Attachment is obsolete: true
Assignee | ||
Comment 22•17 years ago
|
||
Btw, interdiff lies ;) I'm not changing it back to pre bug 395207 -- I'm just not changing it at all.
This blocks bug 396448 in terms of patch landing order.
Blocks: 396448
Reporter | ||
Comment 23•17 years ago
|
||
Checking in toolkit/components/downloads/src/nsDownloadManager.cpp;
new revision: 1.115; previous revision: 1.114
Checking in toolkit/components/downloads/src/nsDownloadManager.h;
new revision: 1.40; previous revision: 1.39
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: blocking-firefox3? → in-testsuite-
Resolution: --- → FIXED
Verified FIXED using Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a9pre) Gecko/2007092705 Minefield/3.0a9pre
Status: RESOLVED → VERIFIED
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•