caisan / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

"Not to download file" causes I/O error and stops all downloading. #471

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

e.g. ABCD.torrent has three files A,B,C.
A is downloaded, moved to another folder, and marked as "Do not download"
B is still downloading
C is still downloading

The program will still sometime try to read file A and issue I/O error so that 
both B and C downloading are stopped.

What is the expected output? What do you see instead?
No I/O error.

What version of the product are you using? On what operating system?
qbittorrent Version 3.0.9
Fedora 18

Please provide any additional information below.

Original issue reported on code.google.com by zhang8...@gmail.com on 5 May 2013 at 4:29

GoogleCodeExporter commented 8 years ago
See https://github.com/qbittorrent/qBittorrent/issues/632

Original comment by zhang8...@gmail.com on 5 May 2013 at 4:30

GoogleCodeExporter commented 8 years ago
how do you move file A?

Do you call torrent_handle::rename_file()?

If you just move it directly at the filesystem level, how would you expect 
libtorrent to know that it was moved, and where to find the data stored in it?

Original comment by arvid.no...@gmail.com on 5 May 2013 at 8:36

GoogleCodeExporter commented 8 years ago
just cut and paste A to another folder. No complicated things.

Original comment by zhang8...@gmail.com on 5 May 2013 at 8:38

GoogleCodeExporter commented 8 years ago
because I marked it as "Do not download" and the libtorrent is stilling trying 
to read/write on this file. That's a bug.

Original comment by zhang8...@gmail.com on 5 May 2013 at 8:39

GoogleCodeExporter commented 8 years ago
of course after I "force recheck files". The problem is gone. However, it 
should not perform like this.

No windows based torrent program has such problem. So you should not either.

Original comment by zhang8...@gmail.com on 5 May 2013 at 8:41

GoogleCodeExporter commented 8 years ago
but "do not download" does not mean "do not upload".

I'm quite certain than all, or at least most, bittorrent clients would behave 
the same.

Would you expect libtorrent to always stop uploading files that are marked as 
do-not-download, or would just just expect libtorrent to allow such files to 
disappear? What about the edge pieces that are required to complete the 
adjacent files?

Original comment by arvid.no...@gmail.com on 5 May 2013 at 9:32

GoogleCodeExporter commented 8 years ago
OK. Now I understand libtorrent's logic.

However, just one thing:
Windows program Bittorrent does NOT have such problem, when marked as "do not 
download", of course it is also "not upload". The reason is simple: where to 
find the data for not-downloaded files?

I DO think you should perform the same way. The Bittorrent never has such 
problem so I think they well fixed the adjacent pieces. You could, as well.

Original comment by zhang8...@gmail.com on 5 May 2013 at 9:38

GoogleCodeExporter commented 8 years ago
Just because a file is marked as do-not-download doesn't mean you don't have 
any data in that file.

You may for instance download the entire file, or part of it, before you mark 
it as do not download. If you have half of the pieces in the file when you mark 
it as do-not-download, those pieces will obviously still be seeded. This is 
certainly the case in uTorrent and BitTorrent mainline, and I would expect any 
quality bittorrent client to behave the same.

It's also possible to download to files even after they have been marked as 
do-not-download. If and adjacent file is marked for downloading, and the first 
or last piece in it overlaps with the file set to not download, that partial 
piece is still downloaded, even though it belongs to the file selected to not 
be downloaded. This is because in order to verify integrity of the piece, and 
in order to be able to seed it, you need the whole file.

uTorrent does this as well. However, those partial pieces are placed in a 
partfile and not in the actual file itself.  But this ticket is about moving 
files away from under the feet of the client.

Original comment by arvid.no...@gmail.com on 5 May 2013 at 9:53

GoogleCodeExporter commented 8 years ago
Whatever, the I/O error needs to be removed otherwise the software performs 
like buggy to users.

Maybe you can perform a "force recheck files" automatically before you throw 
out "I/O error"?

Original comment by zhang8...@gmail.com on 5 May 2013 at 9:56

GoogleCodeExporter commented 8 years ago
I would guess BitTorrent did the "check" automatically so the problem is not 
noticed by users.

Original comment by zhang8...@gmail.com on 5 May 2013 at 9:58