qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.95k stars 3.88k forks source link

Double root folder after renaming #21211

Open YenForYang opened 4 weeks ago

YenForYang commented 4 weeks ago

qBittorrent & operating system versions

qBittorrent: 4.6.5 x64 Operating system: Windows 10 Pro 22H2 x64

What is the problem?

I had a situation where hundreds of torrents were stuck in a "Moving" state. So I decided to tag all the "Moving" torrents, close qBittorrent, and restart the program. Unfortunately, qBittorrent never fully shut down after even an hour. Checking task manager on Windows, I noticed it's "Memory (active private working set)" very slowly decreased until around 40k. Commit size never fell below about 3,000,000K. It's "IO read bytes" or "IO write bytes" weren't changing at all, but it was making small changes in the "IO other bytes". So I assumed it was safe to forcefully terminate -- which I did through taskkill /f /im qbittorrent instead of task manager. I tried doing taskkill /im qbittorrent but that didn't work even after multiple attempts.

I failed to remember that I also had torrent folders being renamed among the "Moving" torrents, and I managed to find 1 torrent with dual root folders in the completed state. It doesn't look like I can fix this without readding the torrent -- I can't remove a root folder or any files from a torrent. I also tried renaming again, but I get a "

---------------------------
Rename error
---------------------------
The folder already exists: 'New folder name'.
---------------------------
OK   
--------------------------

I think the main issue is that qBittorrent maybe doesn't save the status of folder renaming or something on exit? Basically it won't resume a folder rename?

Steps to reproduce

Unsure exactly, perhaps you need a condition where you forcefully terminate while torrents are still being renamed? I had a special scenario where there were hundreds of torrents stuck in the Moving state (Stuck based on the observation that disk activity wasn't happening in the Performance tab in Task Manager, yet the Moving progress of torrents didn't change). Shutting down qBittorrent also appeared to be stuck.

Additional context

I renamed the folders here to be clear: The original folder name is "Old folder name", it was renamed to "New folder name"

image

EDIT: Looks like I gave myself even more trouble by renaming the folders to Old folder name and New folder name. I can't rename them back due to the "folder already exists" error coming up.

Log(s) & preferences file(s)

No response

YenForYang commented 4 weeks ago

I checked the fastresume file of the torrent, it actually looks like it is missing the file(s) from "Old folder name" above (in mapped_files). That does appear to be the only notable difference when compared to freshly adding the torrent (i.e. deleting and readding the torrent, and renaming to "New folder name"). I managed to modify the fastresume and fixed the torrent at least.

luzpaz commented 2 weeks ago

Related?

21126

19304