-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug]: File watcher thread slows down whole application #7873
Comments
Reported at #7873. Signed-off-by: Camila Ayres <hello@camilasan.com>
|
Reported at #7873. Signed-off-by: Camila Ayres <hello@camilasan.com>
Love to see such a fast response! While this will help reduce log files size and speed up the sync progress, the main issue will remain: A single thread needs to react to all the changes, while these can be of multiple thousand of files on each startup of the application. From looking at the source code, this feels quite daunting for a new contributor such as myself, but I would be interested to contribute code if I am pointed to the right spot to start. |
Reported at #7873. Signed-off-by: Camila Ayres <hello@camilasan.com>
We understood it. Thanks for the report! |
Bug description
The file watcher thread gets over-pressured by spurious notifications on Linux.
Running on Arch Linux, present in the most recent Nextcloud desktop release (tried even git version), with an account that has 220k+ files (Server ZFS and client ext4).
I do not know if it could also be a inotify problem (from the code it seems it might be, there are no mentions of Windows but mentions of MacOS not having that issue), and since it even is acknowledged by the person who wrote the code, there is counter-measures to discard a file that has not changed. Which is great! But since it does check, it also writes thousands upon thousands of log lines, running the operation to a slog. To see if it would help, I changed the qcInfo call to a qcDebug, recompiled in Release mode and the application went from being unresponsive for hours to... being unresponsive for a few minutes. Which is a major improvement!
But this does raise an important question: why isn't that file watching thread being run in a separate thread as the main one? If it is so computationally intensive task, running it in the background and maybe writing to the log files the number of spurious notification met would keep the main application responsive and the experience much more smooth. I do understand the value of seeing per-file spurious notification discard, but this tie into major issues where users have hundreds of MB of logs written on every sync. Being able to set the debug level to write to logs in the application could also be a solution to this situation.
The offending code : slotWatchedPathChanged and more specifically this line that prints heavily on the log file
I hope to see that line changed from qcInfo to qcDebug in the next release so I can finally use VFS on my laptop. In the long-term, I hope that this process can be multi-threaded to avoid the main applet being unresponsive during this operation.
Anyway, thanks for making such a great self-hosting cloud application!
Steps to reproduce
Expected behavior
OR
Which files are affected by this bug
src/gui/folder.cpp
Operating system
Linux
Which version of the operating system you are running.
Linux 6.13.2-arch1-1
Package
Compiled it myself
Nextcloud Server version
30.0.4
Nextcloud Desktop Client version
3.16-rc1
Is this bug present after an update or on a fresh install?
Fresh desktop client install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
Are you using an external user-backend?
Nextcloud Server logs
Additional info
No response
The text was updated successfully, but these errors were encountered: