Infomaniak / desktop-kDrive

:computer: Desktop Syncing Client for kDrive
GNU General Public License v3.0
19 stars 4 forks source link

Syncronization of large files fails on Linux systems with too-small /tmp #204

Open alerighi opened 2 months ago

alerighi commented 2 months ago

On some Linux distributions (e.g. ArchLinux) the /tmp directory is mounted as a tmpfs in RAM by default. Since it's mounted in RAM, it has a limited capacity (on my system, that has 8Gb of RAM, the tmpfs is 4Gb in capacity).

I've noticed that kDrive was unable to sync some large (5+Gb) files that are on my drive. I've seen from the logfile that the download did indeed fail because the space on /tmp was finished. I've then modified the configuration of my system to mount /tmp on a real disk partition (the same that is done on Debian and other distributions) and the synchronization errors did indeed disappear.

/tmp shouldn't be used to store large files, not only because it has a limited capacity but also because storing data here wastes RAM on systems where the /tmp is a RAM filesystem.

In my opinion it would be better if kDrive would store temporary files inside the user home directory (e.g. in ~/.cache/kDrive). Alternatively you would need to document this behavior, and provide an option for the user to set the path of the temporary directory (or document it if there is already such a parameter).

Thanks!

alerighi commented 2 months ago

Also, I've noticed that these temporary files are not removed even after the file is completely downloaded. This causes a waste of RAM/disk space, till the next reboot (if /tmp is emptied at reboot or in a RAM tmpfs).

ClementKunz commented 2 months ago

Hi, Thanks for report. Yes, that is something we noticed on Manjaro Linux as well. This is in our backlog. We hope to be able to deliver a fix in in upcoming versions.

eylenburg commented 1 month ago

I noticed the same problem on Fedora and OpenSUSE. Not only does the sync stop working when /tmp is full, it also creates duplicates of files (conflicted copies).

A crude workaround when this happens is to pause the sync, run sudo rm /tmp/kdrive*, and unpause the sync.