Bug 426039

Summary: Dolphin causing unnecessary load on network file systems
Product: [Applications] dolphin Reporter: AlexDeLorenzo.dev <rare_energy>
Component: view-engine: details modeAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kfm-devel, meven29, yvan
Priority: NOR    
Version: 19.12.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description AlexDeLorenzo.dev 2020-08-31 22:28:50 UTC
SUMMARY

This occurs with sshfs, as well as any file system implemented with FUSE.

When using "Details view mode", Dolphin will explore sub-directories of the current working directory. The only columns I have displayed are "Name" and "Modified", neither of which are dependent on information gleaned from scanning sub-directories. I also have previews disabled for folders in Dolphin's settings. 

To give you an example, let's say we have sshfs mounted at `/mnt/sshfs`:

    $ ls /mnt/sshfs
    (dir) example
    (dir) example2
    test.txt


If we run `dolphin /mnt/sshfs` and do absolutely nothing else but look at the contents of the screen, in the background, Dolphin will scan the sub-directories of the current working directory. Meaning, Dolphin will scan `example`, `example2` and so on without the user exploring the directories themselves. I was able to confirm that Dolphin was doing this in the background by logging file system access and using Dolphin.


This is particularly expensive for network file systems, especially with sshfs, as upload speeds for consumer connections are very low compared to their download speeds. 

This can also be a literally expensive operation if the file system is a FUSE fs over something like S3.

If the current working directory contains tens, or hundreds of folders, it could degrade their experience as the content is loaded in the background.

It's also unnecessary wear on a disk.

For my use case, this impacts the users of one of my FUSE apps. In the app, I set a rate limiter in front of a web API.  When Dolphin opens things in the background, that rate limit is hit with no interaction from the user at all. When users then do go to interact with their systems, they are rate limited because of Dolphin's high background load, and they have diminished experiences.

I understand that the "Size" column will count items in a folder, but I believe you could turn that feature off at one point.  I also remember being able to turn off pre-fetching of data from network volumes. 

"Compact view mode" and "icon view mode" do not cause Dolphin to load sub-directories, which is what I believe to be the correct behavior, and the behavior I believe  "Details view mode" should implement. 


--


STEPS TO REPRODUCE

1. Mount a FUSE file system like sshfs
2. Navigate to the mount point with Dolphin
3. Observe network and file system activity

OBSERVED RESULT

Dolphin will explore sub-directories of the current working directory despite, unnecessarily draining the user's resources and providing a degraded experience.

EXPECTED RESULT

Ideally, Dolphin won't load expense resources in the background for network and user file-systems. These are commonly implemented via FUSE, and Dolphin currently treats FUSE file systems as if they're local block devices instead of what could be FUSE abstractions over expensive network and hardware operations.


 - I think "Details view mode" should behave like "Icon view mode" and "Compact view mode" by not exploring sub-directories in the background.

 - I think users should be able to set whether or not Dolphin should explore sub-directories while using it as a file explorer.

 - There should be a way to signify if a file system is a network file system, and Dolphin should not issue excessive operations on file systems it can't identify as pointing to local block devices.

 - I think Dolphin should be conservative when it encounters FUSE file systems, too.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Ubuntu 20.04 LTS / Kernel 5.8
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION

N/A
Comment 1 Méven Car 2023-04-07 08:11:23 UTC
>  - I think users should be able to set whether or not Dolphin should explore sub-directories while using it as a file explorer.

Users already can.

Two ways are available:
 * hide the size column in the details view 
 * disabling dir file counting in the Details Views settings, (by setting the depth to 0).

>  - There should be a way to signify if a file system is a network file system, and Dolphin should not issue excessive operations on file systems it can't identify as pointing to local block devices.

It does thanks to https://invent.kde.org/system/dolphin/-/merge_requests/507 starting from Dolphin 23.04.

*** This bug has been marked as a duplicate of bug 465357 ***