arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation

Home Page:http://libtorrent.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libtorrent 2.0.5 is supressing the update of the "last modified" metadata of a file that is in transit (still downloading)

WeeBit28 opened this issue · comments

Please provide the following information

libtorrent version (or branch): 2.0.5

platform/architecture: Windows 10 64bit

compiler and compiler version: N/A

please describe what symptom you see, what you would expect to see instead and
how to reproduce it.

I am using the Windows version of qBittorrent 4.4.2 (which incorporates libtorrent 2.0.5), with the following setup:

  1. qBittorrent on a Windows machine, where I download large video files (mvks) to a folder
  2. A rsync-like program called Bvckup2 on the same Windows machine, that is watching the video folder and transfers any new files it detects to a Ubuntu 18.04.06 LTS machine in the same network, via a Samba share.
  3. The backup configuration is "continuous", which is to say the backup program watches the source (the windows folder) and updates any changes in it on the destination (the Ubuntu machine), as they are detected in real-time.

This worked flawlessly for a couple of years, when all of a sudden, files started to end up corrupted on the destination.

After some digging around, I've learned that the backup software relies on reading the "last updated" metadata of the file that is in transit to detect changes. The newer libtorrent 2.0.5 version incorporated in qBittorrent seems to be suppressing the update of that metadata, preventing the backup software from detecting any changes.

As a result, the backup software only copies an initial version of the file in a corrupt/unfinished state.

I can confirm that it's because of a change of behavior in libtorrent 2.* (which I understand has switched to using memory mapped files), because the problem does not reproduce with qBittorrent 4.3.9, which is using libtorrent 1.2.15.0.

I've also a version of qBittorrent 4.4.2 with libtorrent 1.2.15.0 built for regression testing, and sure enough, it did not have the problem.

It would be greatly appreciated if this could be looked at. I would very much rather be able to use the improvements of the latest version of libtorrent with the setup I have.

For reference, here are links with tickets I've opened elsewhere about this:

  1. With Bvckup2 support: https://bvckup2.com/support/forum/topic/1480
  2. On the qBittorrent git issue tracker: qbittorrent/qBittorrent#16811

Many thanks.

Bump.