This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Torrent forgets where it is [Ktorrent 3.2.1]

Tags: None
(comma "," separated)
Kalessin
Registered Member
Posts
78
Karma
0
I've noticed this for a while, so it's not specific to version 3.2.1, but torrents have a habit of forgetting where they are. That is, the location that they show in the torrent window changes to the root directory. So, if the torrent were at /home/user/torrents/thetorrent/, then it starts to think that it's at /thetorrent/. So, opening the file or directory that it's in from ktorrent fails (since, naturally, it's not actually in the root directory). Also, I've had torrents stop running due to low disk space because there isn't much space on my root partition even though there's plenty on the partition that the torrent is actually on. Interestingly enough, however, checking the data works just fine, so ktorrent has the correct location information somewhere. I guess that it keeps it in two places and one of them gets corrupted, so the features that use the corrupted location fail, while those that use the uncorrupted one don't.

Unfortunately, I have absolutely no clue under what circumstances torrents forget their correct location. I have plenty of torrents that have the correct location as well as a number that don't. Certainly, I'd say that the older the torrent is, the more likely it is that it's forgotten where it is, but not all older torrents have forgotten their location.

So, I can point out the symptoms, but I'm afraid that I'm more or less no help in finding the root cause. Maybe it has something to do with what torrents are running when ktorrent exits or when it crashes (though I wouldn't have thought that either ktorrent or KDE crashed consistently enough for it to be due to crashes). But again, I really have no clue.
George
Moderator
Posts
5421
Karma
1

Fri Apr 10, 2009 6:36 am
When you get this, open the torrent's temporary directory and take a look at the file_map and stats files.

The stats file should contain a variable named OUTPUTDIR which should point to the torrent's location. The file_map file contains a line for each file in the torrent with the full path of the file.
Kalessin
Registered Member
Posts
78
Karma
0

Fri Apr 10, 2009 7:21 am
George wrote:When you get this, open the torrent's temporary directory and take a look at the file_map and stats files.

The stats file should contain a variable named OUTPUTDIR which should point to the torrent's location. The file_map file contains a line for each file in the torrent with the full path of the file.


The torrents which have forgotten their location appear to have / for OUTPUTDIR in the stats file while each file listed in the file_map file retains its full path.
George
Moderator
Posts
5421
Karma
1

Mon Apr 13, 2009 10:57 am
There has got to be something going wrong with saving the stats file.

Maybe there is not enough disk space to save, so the file is incomplete or not saved at all.

Are you also losing how much data is uploaded of these torrents ?
Kalessin
Registered Member
Posts
78
Karma
0

Sat Apr 18, 2009 12:13 pm
George wrote:There has got to be something going wrong with saving the stats file.

Maybe there is not enough disk space to save, so the file is incomplete or not saved at all.

Are you also losing how much data is uploaded of these torrents ?


I definitely have enough disk space. That shouldn't be a problem at all. I have in excess of 40GB free on my home partition. As for losing the amount uploaded, that's hard to say. I don't usually notice that a torrent has lost its location until well after the fact and I really don't know what the upload amount on a particular torrent should be, so it could have lost its lunch several hours - if not days - before I notice it and have uploaded enough by then to look like it didn't lose the count on the amount uploaded. I'll have to watch out for this in the future, but it's not easy to catch - particularly since I have a lot of torrents loaded in ktorrent and quite a few of them have already forgotten where they are on the disk.

Actually, on closer inspection, I found a torrent which I believe should have been uploading but is currently listed as having uploaded 0B, and it has forgotten its location. I suppose that it could have just not managed to upload anything due to a lack of leechers, but I would have expected it to be above 0. So, my guess is that when a torrent loses its location, it also loses its upload amount, but I'm not entirely sure.
George
Moderator
Posts
5421
Karma
1

Mon Apr 20, 2009 6:56 pm
Kalessin wrote:
George wrote:There has got to be something going wrong with saving the stats file.

Maybe there is not enough disk space to save, so the file is incomplete or not saved at all.

Are you also losing how much data is uploaded of these torrents ?


I definitely have enough disk space. That shouldn't be a problem at all. I have in excess of 40GB free on my home partition. As for losing the amount uploaded, that's hard to say. I don't usually notice that a torrent has lost its location until well after the fact and I really don't know what the upload amount on a particular torrent should be, so it could have lost its lunch several hours - if not days - before I notice it and have uploaded enough by then to look like it didn't lose the count on the amount uploaded. I'll have to watch out for this in the future, but it's not easy to catch - particularly since I have a lot of torrents loaded in ktorrent and quite a few of them have already forgotten where they are on the disk.

Actually, on closer inspection, I found a torrent which I believe should have been uploading but is currently listed as having uploaded 0B, and it has forgotten its location. I suppose that it could have just not managed to upload anything due to a lack of leechers, but I would have expected it to be above 0. So, my guess is that when a torrent loses its location, it also loses its upload amount, but I'm not entirely sure.


That would mean that the stats file is getting corrupted, the question is how and why.
Kalessin
Registered Member
Posts
78
Karma
0
Well, my computer froze this morning and I was forced to reboot it. When I got back into KDE and started up ktorrent, it appears to have remembered all of the torrents, but it lost all the statistics that it had for them and most (though for some reason not all) forgot where they were. So, having ktorrent not shut down properly seems to be a situation where the stats file can get corrupted. Of course, other programs had issues too (e.g. konqueror lost all its bookmarks), but this is a situation where ktorrent clearly forgot where many of its torrents were actually located.

Unfortunately, I still have no clue under what circumstances this happens when there isn't a crash. Oh, and I'm using Ktorrent 3.2.3, so the problem doesn't appear to have gone away thanks to other changes since 3.2.1.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]