[dolphin] [Bug 465357] New: Dolphin's UI freezes when stat() is slow
Andrew Gunnerson
bugzilla_noreply at kde.org
Mon Feb 6 03:51:20 GMT 2023
https://bugs.kde.org/show_bug.cgi?id=465357
Bug ID: 465357
Summary: Dolphin's UI freezes when stat() is slow
Classification: Applications
Product: dolphin
Version: 22.12.2
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: dolphin-bugs-null at kde.org
Reporter: accounts+kde at chiller3.com
CC: kfm-devel at kde.org
Target Milestone: ---
Created attachment 155992
--> https://bugs.kde.org/attachment.cgi?id=155992&action=edit
A patch to skip directory counts when KFileItem::isSlow
SUMMARY
When stat() does not complete quickly, Dolphin's UI freezes until it returns.
This seems to be the root cause for the freezes I'm encountering. Specifically,
when I try to access a `cifs` mount point, Dolphin kicks off
`KDirectoryContentsCounter.scanDirectory()` for all the subdirectories visible
on screen. The opendir/readdir calls are enough to slow down the server to the
point where each stat takes a couple of seconds. Once stat starts slowing down,
the Dolphin's UI stops responding.
I've been working around the problem by making Dolphin skip
`KDirectoryContentsCounter.scanDirectory()` if `KFileItem::isSlow()` is true
(patch attached). Even though this hides the issue, I wonder if it may be good
to have anyway since it matches the behavior of kio smb://, where directory
counts don't happen.
STEPS TO REPRODUCE
To avoid the need to connect to a slow server, I've attached an LD_PRELOAD'able
library to help reproduce this. It slows down all stat calls to paths under
/home/, except for paths containing "/." so that Dolphin's startup isn't slowed
down when reading configs.
1. $ g++ -shared -fPIC slow_stat.cpp -o slow_stat.so
2. $ LD_PRELOAD=$(pwd)/slow_stat.so dolphin
3. Navigate to somewhere under /home/
4. Try to perform UI actions, like hovering over items, selecting, right
clicking, opening menus, etc.
OBSERVED RESULT
Dolphin's UI freezes until stat returns
EXPECTED RESULT
Dolphin should ideally remain responsive while stat occurs
SOFTWARE/OS VERSIONS
Windows: n/a
macOS: n/a
Linux/KDE Plasma: Fedora 37
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
ADDITIONAL INFORMATION
(Patch for my workaround is attached)
I've also tried compiling the latest commit in dolphin
(580f3bf0d5c8735cf230208fd6e4b288a3e55722) and there's no change in behavior.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the kfm-devel
mailing list