Bug#968205: tumbler: Tumbler daemon (tumblerd) using 100% CPU (single thread)
Tags: lfs upstream
The tumbler daemon uses massive amounts of CPU (90-100%) on a single thread sporadically. Once it does, even closing all applications does not work and the process requires manual termination. I believe it relates to lfs owing to bugs 788271 and 827427, _however_ the issue persists even _after_ closing large files or copy-completion, leaving termination. So, while triggered by large files, there is a secondary bug (IDK if I should report it separately).
This is very an upstream problem since I've found serveral cases of it across multiple distributions (at least on GNU/LINUX, I've not seen mention on other systems) while browsing (it is good to check other distros when reporting problems).
1) I believe there is a missing (or incorrectly implemented) sleep in the source which causes it to scan on a near (or full) per-clock cycle. Where sleeping for a few hundred ms or even a second would cause a "blink" for the user (depending, < 500ms is unotticeable), I believe it's a fair trade-off.
2) I would suggest that a files be checked for being "in use" and that if true, to continue using the already-cached thumbnail until released. This is the most elegant solution (and it would prevent, but not fix, the secondary bug).
3) As for the secondary problem, i.e. needing manual termination, the best "quick hack" is for it simply to check its resource use (yes it would kill itself under certain conditions, however there is no reason a calling process cannot exist to monitor it, killing and restarting as needed). It's a dirty-ish hack but would be a good temporary cure while the underlying code is being fixed.
I hope this is of use. I realise that the maintainer(s) is/are not technically responsible, but this seems like a better way to get the upstream developer(s) to get something done (I saw a similar behaviour complaint dating back 5 years).
-- System Information:
Debian Release: 10.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.4.0-0.bpo.4-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_ZA.UTF-8, LC_CTYPE=en_ZA.UTF-8 (charmap=UTF-8), LANGUAGE=en_ZA:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages tumbler depends on:
ii libc6 2.28-10
ii libcairo2 1.16.0-4
ii libfreetype6 2.9.1-3+deb10u1
ii libgdk-pixbuf2.0-0 2.38.1+dfsg-1
ii libglib2.0-0 2.58.3-2+deb10u2
ii libgstreamer-plugins-base1.0-0 1.14.4-2
ii libgstreamer1.0-0 1.14.4-1
ii libjpeg62-turbo 1:1.5.2-2+b1
ii libpng16-16 1.6.36-6
ii libpoppler-glib8 0.71.0-5
ii libtumbler-1-0 0.2.3-1
ii tumbler-common 0.2.3-1
ii zlib1g 1:1.2.11.dfsg-1
tumbler recommends no packages.
Versions of packages tumbler suggests:
pn tumbler-plugins-extra <none>
-- no debconf information