Bug 256774 - kget erase and start downloads from the beginning
Summary: kget erase and start downloads from the beginning
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: 0.8.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 09:29 UTC by Dj YB
Modified: 2011-02-07 16:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dj YB 2010-11-13 09:29:30 UTC
Version:           0.8.1 (using KDE 4.5.2) 
OS:                Linux

kget had to be killed because after becoming un-responsive.
then when started again it erased an already finished download and started it again.
and another almost finished download also.

Reproducible: Didn't try



Expected Results:  
checking or asking before deleting anything.

OS: Linux (i686) release 2.6.34.7-56.fc13.i686.PAE
Compiler: gcc
Comment 1 Matthias Fuchs 2010-11-13 17:24:14 UTC
The problem is that KGet hang in the first place.
Can you please describe what lead to it being unresponsive?
Did it happen once the downloads finished, how long did you wait before killing it etc. ...

On the redownloading, it sounds like it did not manage to save the change of the download state -- it does that once a download finishes -- most likely because of it hanging.
Comment 2 Dj YB 2010-11-13 17:29:06 UTC
yes, once a download got to 99% it hanged for several minutes. then I killed it.
Comment 3 Matthias Fuchs 2010-11-13 19:07:32 UTC
This sounds Nepomuk related.
Does it hang for you if you disable Nepomuk?

PS.: No I do not mean that Nepomuk is slow per se, often it is DBus etc. for me the same thing was slow with KDE versions many months ago and now it is blazingly fast.
Comment 4 Dj YB 2010-11-13 20:07:08 UTC
it didn't hang again even without disabling anything.
Comment 5 Matthias Fuchs 2010-11-13 22:41:28 UTC
Ok, so then I'll close this bug.

The not saving was because it did not reach 100% while it hang. And the hanging is most likely (99,9%) Nepomuk related and in KDE 4.5.4 setting of Nepomuk stuff has changed, it will happen in its own thread and should not block then anyway.

So in general you should not have this issue anymore with 4.5.4.
Comment 6 Dj YB 2010-11-13 22:58:05 UTC
what do mean by "not saving"?
the file was fully downloaded (100%), it was a movie and I played it to the end before restarting kget.
then kget erased it and started downloading it all over again.
the second file was 99% and was not supposed to be erased also.

that sounds to me like a problem.
shouldn't kget check before erasing anything?
Comment 7 Matthias Fuchs 2010-11-14 01:59:56 UTC
KGet asks you if you want to overwrite a file etc. but not if you have already a transfer that is not finished -- that is what I think happened here.
I think that because of the crash/killing saving the kget transfers.kgt file did not work and thus neither the current downloaded segments, nor the current state were saved.

Instead the thing that had been saved was that the transfers existed -- that gets done once a transfer is added.


That a lot of time passed between the one transfer finishing and then killing KGet sounds suspicous though. Did you add both transfers at the same time? And if not how far was the transfer that finished later on? Did the transfer that was finished start at 0% then?
Comment 8 Dj YB 2010-11-14 05:13:51 UTC
the two transfers were added in about a minute or two one after the other (can't remember exactly).
the transfer that finished was started the second.
Comment 9 Matthias Fuchs 2010-11-14 14:06:28 UTC
And was the one transfer already hanging when the other finished?
Comment 10 Dj YB 2010-11-14 14:17:51 UTC
to make it clear:
download A started at t=0
download B started at t=60
download B finished at t=100
download A reached 99% at t=150
at t=151 kget hanged for long time.
then I killed it. and started it again.
then kget erased the already fully downloaded B and the 99% already downloaded A and started them both from 0%.

sorry for the misunderstanding.
Comment 11 Matthias Fuchs 2010-11-15 19:26:50 UTC
This is really tricky as it should have been saved. What kind of protocol was download B?
Comment 12 Dj YB 2010-11-15 20:37:02 UTC
all http
Comment 13 Matthias Fuchs 2010-11-17 16:35:56 UTC
I guess I found the bug.

Could you please tell me which of those download plugins is activated in the settings: "KIO" and/or "Multi Segment KIO"

I think that only KIO is activated, and there as I have noticed now no signal gets emitted if the download is finished, i.e. no changes are written to transfers.kgt.
Comment 14 Matthias Fuchs 2010-11-17 16:39:58 UTC
Oh, maybe I was wrong in the above, in any case please still tell me which plugins are activated.
Comment 15 Dj YB 2010-11-17 16:56:26 UTC
both KIO and Multi segment KIO plugins are activated.
Comment 16 Matthias Fuchs 2010-11-24 19:24:53 UTC
Ok I might have found the error this time -- hmmm that is getting repetitive ;).

Do you remember if KGet reported a size for download B, or did it only reported a size once it was finished?

I.e. there are two possible cases:
1. You start the download, after a short while KGet shows a size of XY Bytes for B, the size of the file
2. You start the download, only when it finished KGet shows its size
Comment 17 Matthias Fuchs 2010-11-24 20:41:31 UTC
SVN commit 1200339 by mfuchs:

If a download did not report a totalsize do not use the finished chunks to calculated its processed size, as none has been set to finished.
BUG:256774

 M  +7 -5      datasourcefactory.cpp  
 M  +5 -0      datasourcefactory.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1200339
Comment 18 Matthias Fuchs 2010-11-24 20:58:14 UTC
SVN commit 1200346 by mfuchs:

Backport r1200339
If a download did not report a totalsize do not use the finished chunks to calculated its processed size, as none has been set to finished.
CCBUG:256774

 M  +7 -5      datasourcefactory.cpp  
 M  +5 -0      datasourcefactory.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1200346
Comment 19 Matthias Fuchs 2010-11-24 20:59:41 UTC
Hi, I only did those two commits, to make sure this ends up in 4.5.4, so if what you experienced is "case 2" this bug is fixed, otherwise not.
If it is not please reopen.

Sorry for all the hassle.
Comment 20 Dj YB 2010-11-24 22:07:16 UTC
thanks,
I think it was option 1 but really can't remember for sure now. 
I don't know how to reopen a bug.
Comment 21 Matthias Fuchs 2010-11-24 22:40:39 UTC
I just noticed that I reopened it by accident anyway. If you still have the link to the file you could try it.
Comment 22 Matthias Fuchs 2011-02-07 16:04:44 UTC
I really think that this should be fixed, so if you experience this kind of problem in 4.6 then please reopen (changing the status to unconfirmed, or reopened if the later exists) the bug.