New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renaming a folder with a locked file causes irreversible folder split #4761
Comments
Of course it 'breaks' everything, qbittorrent/libtorrent does NOT 'know' that the data has been changed, it just 'knows' that the 'file' is NOT where it is supposed to be and is therefore "missing". |
Oh, and there is no 'fix' that can be applied in qbittorrent/libtorrent. |
Not quite sure what your point is. If libtorrent finds a 'file' or piece that is missing, corrupted, locked or otherwise broken it WILL at least attempt to repair the payload if it can, by downloading the 'missing' pieces using the information in the metadata, and by the sounds of it you are 'breaking' the payload and libtorrent is promptly repairing the problem. |
Personally i dont see this as a concern, likely because i dont move qbittorent files around like that, i move/rename the folder in explorer (errors here if theres a problem like lockfiles/in use) then i change the torrent destination in qbittorent via right click > set location. If you need to initially change a path directory inside qbtorrent for some reason why not perform it on this screen? If i understand your scenario/proposal correctly you're saying that instead of performing the folder split/move it would be better for qbittorent to detect a failure to move due to a locked file (or other) and cancel the update/change & inform the user eg "foo.txt is currently locked, changing this option will result in a folder split, Do you wish to continue" Tl;dr libtorrent handling this functionality works as intended, whats missing would be better detection for when this scenario occurs + a user prompt to confirm/deny the change/folder split yes? |
--Preface: I have not and continue to not mention "libtorrent" because this is about UI functionality, and was never about chunks or downloads. At no point was any file or chunk orphaned from its download or forced to repair or re-download. |
I just hit this same issue In my case, I'm renaming and organizing multiple files to match my expected folder and file structure. While renaming the parent downloaded folder ("Show.S02" to "Season 2", its downloaded within a parent folder for the show), a single file was locked and I'm now stuck with multiple child folders. I had to remove and re-add the torrent (re-fixing the file names) to fix this |
This issue has been closed and locked for being too old, and thus either most likely resolved in recent versions or no longer applicable. A new issue report with relevant updated data gathered from the latest version is preferable to necroing an old report with a comment like "still happens in version x.y.z", even if you think the bug is the same, or suspect of a regression. Thank you for your contributions. |
If you attempt to rename a folder inside of a torrent's content structure while one of those files is locked (ex. by a background file system backup service like CrashPlan), then all of the unlocked files will be moved and the locked file will not. In the Content UI, the files will now be split across two separate folders where they were once in a single folder. If you break the lock and attempt to rename the left-behind file's folder to the intended destination, qbittorrent refuses as there is already a folder with that name -- you are left unable to merge the split folders back together short of removing the torrent's metadata, re-adding it, and rechecking the files.
When this affected me, there were no log entries created.
The initial folder split behavior is probably the most reasonable answer absent exclusive-locking every single file to-be-moved before beginning any moves, and could only stand to be improved by a "failed to move file in folder of torrent " message in the log. The recovery behavior could be greatly improved: when renaming a folder and detecting an existing folder with the same name, if that destination folder is also part of this current torrent, then the folder rename should proceed to a filename collision check and then be allowed. This would enable a user to merge together any split folders in a graceful manner.
The text was updated successfully, but these errors were encountered: