Opened 8 years ago
Last modified 7 years ago
#2833 new bug
multiple torrents with overlapping folder structures lose incomplete files when 1st torrent completes
Reported by: | eguled | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | needs verified |
Component: | Unknown | Version: | 1.3.15 |
Keywords: | overlaps incomplete moved folders temporary files completed | Cc: |
Description
I have seen this issue multiple times, with multiple torrent sets under Deluge v1.3.12 (libtorrent v1.0.6.0) running on Windows 7 x64. This issue can result in lost data which can be expensive if the files involved are large and the bandwidth is metered... :-(
Issue: Start 2 different torrents that each contain an overlapping folder structure. Let's call them "A" and "B".
While downloading, files for both A and B are stored in the same parent folder under the Deluge working/incomplete files directory.
When torrent A completes downloading, if the users has selected the option to "move completed to" [user-specific folder], then the entire parent directory -- and consequentially all the files for *both* torrents -- gets moved rather than moving only the completed files for torrent A. The result is that torrent A completes successfully and files are moved to correct location, but that torrent B loses any progress it had an shows an Error in the UI.
I'm not sure if this happens in Deluge itself or in libtorrent (I suspect it may be the latter). But it seems like the fix would be to be to, on completion, a) first check if the folder overlaps with another incomplete torrent, if not proceed as normal. if overlap is found, have the code enumerate the individual files of the completed torrent and move them 1x1 rather than simple moving the directory. this could potentially leave empty folders behind in the temp directory unless they are accounted for as well, but I think that is a much better consequence than lost data.
Simple, contrived example:
Torrent A contains: livediscs\lmde-2-201503-cinnamon-64bit.iso
Torrent B contains: livediscs\linuxmint-17.3-cinnamon-64bit.iso
WIP location: D:\temp
"Move Completed To" location: D:\Downloads
Current behavior:
Point in time | Torrent | State = | Location |
---|---|---|---|
start | A | In-Progress | D:\temp\livediscs\lmde-2-201503-cinnamon-64bit.iso |
start | B | In-Progress | D:\temp\livediscs\linuxmint-17.3-cinnamon-64bit.iso |
A has finished | A | Complete | D:\Downloads\livediscs\lmde-2-201503-cinnamon-64bit.iso |
A has finished | B | In-Progress | D:\Downloads\livediscs\linuxmint-17.3-cinnamon-64bit.iso |
Expected behavior:
Point in time | Torrent | State = | Location |
---|---|---|---|
start | A | In-Progress | D:\temp\livediscs\lmde-2-201503-cinnamon-64bit.iso |
start | B | In-Progress | D:\temp\livediscs\linuxmint-17.3-cinnamon-64bit.iso |
A has finished | A | Complete | D:\Downloads\livediscs\lmde-2-201503-cinnamon-64bit.iso |
A has finished | B | In-Progress | D:\temp\livediscs\linuxmint-17.3-cinnamon-64bit.iso |
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 7 years ago
The bug is still there and a current (1.3.15) behavior is actually worse than the one described in a ticket. Deluge still moves an entire directory upon completion of the first torrent, but instead of error and losing incomplete files you end up with corrupted files from a second torrent in a target-to-move directory while deluge thinks that this files are ok and completed. Recheck usually shows 95-97% completion so it seems it looses chunks that were been downloaded at exact time of moving but does mark them as completed.
comment:3 by , 7 years ago
Version: | 1.3.12 → 1.3.15 |
---|
I realized that there is a workaround for this, assuming that the torrents are not downloading faster than you can do it.
Everything looked correct in my temp folder and after torrent A completed, only torrent A's files were moved.
It would still be nice to have this fixed so that it works without user intervention. But considering the workaround, this issue is probably a lower priority.