Bug 495145

Summary: baloo_filemetadata_temp_extractor causes dolphin to freeze when large files are scanned for details
Product: [Applications] dolphin Reporter: Angelos Skembris <a.skembris>
Component: panels: informationAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kdedev, kfm-devel, meven, tagwerk19
Priority: NOR    
Version: 24.08.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Angelos Skembris 2024-10-21 14:55:47 UTC
SUMMARY

When accessing a folder with large video files (>5 Gb at least), dolphin will freeze for a few seconds. According to the system monitor output, this happens while baloo_filemetadata_temp_extractor is parsing the files to extract details that are usually shown in the "Information" side panel (e.g. dimensions, duration, etc.) (System monitor shows large read rates from baloo_filemetadata_temp_extractor). 

The effect is annoying on an SSD, but makes Dolphin practically unusable in the case of HDDs (which I am using in this case, as the video files are quite large, I have a lot of them and I don't particularly care about writing speeds). 

Note that I have disabled file indexing and set the threshold for the option "Show previews" to files below 100Mb) (although I think this refers to the icon thumbnails, not the "Information" metada?)

As a workaround, I renamed the executable /usr/bin/baloo_filemetadata_temp_extractor so that it stops parsing the files. I don't get any metadata in the "Information" any more, but it beats not being able to use Dolphin at all (for these folders, at least). 


STEPS TO REPRODUCE
1. Place large (>5 Gb) video files in a folder, probably multiple such files.
2. Open the folder using Dolphin
3. Click or hover over any of these files. 

OBSERVED RESULT

Dolphin freezes for a few seconds until it extracts the metadata from the files.

EXPECTED RESULT

I would expect Dolphin to remain responsive or not to extract the details of these files, as these files exceed the "Show previews" threshold I have set (I am fine with not seeing the details for so large files since parsing to extract metadata takes a while). 

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20240916
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 TraceyC 2024-10-24 21:17:44 UTC
I'm not able to reproduce this on Dolphin built from git-master or on a system with Plasma 6.1.5 and Dolphin 24.08.2 (with balooctl enabled)
I tested with File Search settings set it to  "File names and contents" as well as just file names
With git-master I tested on Wayland as well as X11

Disk used: external 2.5" HDD in an enclosure, connected over USB A
Set Dolphin to show previews (F12)
Tested by opening a folder in Dolphin containing a 19.5GB video

I saw no delay in Dolphin, and was able to browse around the window normally

I'll leave this open to see if someone else can reproduce it
Comment 2 Angelos Skembris 2024-10-25 11:18:02 UTC
(In reply to TraceyC from comment #1)
> I'm not able to reproduce this on Dolphin built from git-master or on a
> system with Plasma 6.1.5 and Dolphin 24.08.2 (with balooctl enabled)
> I tested with File Search settings set it to  "File names and contents" as
> well as just file names
> With git-master I tested on Wayland as well as X11
> 
> Disk used: external 2.5" HDD in an enclosure, connected over USB A
> Set Dolphin to show previews (F12)
> Tested by opening a folder in Dolphin containing a 19.5GB video
> 
> I saw no delay in Dolphin, and was able to browse around the window normally
> 
> I'll leave this open to see if someone else can reproduce it

Thank you very much for looking into this. Could the fact that balooctl is enabled affect this behaviour? If the files are indexed maybe the metadata have already been extracted? (I have file indexing disabled on my systems).
Comment 3 tagwerk19 2024-10-25 12:49:16 UTC
(In reply to Angelos Skembris from comment #2)
> Thank you very much for looking into this. Could the fact that balooctl is
> enabled affect this behaviour? If the files are indexed maybe the metadata
> have already been extracted? (I have file indexing disabled on my systems).
As far as I remember... If you have Baloo indexing the folder, it extracts the file metadata (and hold the results in its index). That means that Dolphin can ask Baloo for the data - for the whole folder - and can use it when populating columns, if you have chosen to list metadata, or sort on particular metadata.

If Baloo is not running (or you have excluded the folder), Dolphin has to go to each file "there and then" and extract the info it wants. Could easily be that you see a pause while this is happening.
Comment 4 Méven 2024-10-26 08:13:49 UTC
(In reply to tagwerk19 from comment #3)
> (In reply to Angelos Skembris from comment #2)
> > Thank you very much for looking into this. Could the fact that balooctl is
> > enabled affect this behaviour? If the files are indexed maybe the metadata
> > have already been extracted? (I have file indexing disabled on my systems).
> As far as I remember... If you have Baloo indexing the folder, it extracts
> the file metadata (and hold the results in its index). That means that
> Dolphin can ask Baloo for the data - for the whole folder - and can use it
> when populating columns, if you have chosen to list metadata, or sort on
> particular metadata.
> 
> If Baloo is not running (or you have excluded the folder), Dolphin has to go
> to each file "there and then" and extract the info it wants. Could easily be
> that you see a pause while this is happening.

It seems it is done in dolphin main thread through, that’s the bug, initiated by the information panel.
It should be done off-thread.

There has been attempt to fix this:
https://invent.kde.org/libraries/baloo-widgets/-/merge_requests/63/