Bug 435024

Summary: Baloo hopefully bluffing about indexing its index
Product: [Frameworks and Libraries] frameworks-baloo Reporter: tagwerk19
Component: Baloo File DaemonAssignee: Stefan Brüns <stefan.bruens>
Status: RESOLVED NOT A BUG    
Severity: minor CC: baloo-bugs-null, nate
Priority: NOR    
Version First Reported In: 5.80.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description tagwerk19 2021-03-27 16:54:56 UTC
SUMMARY:

    Baloo is hopefully bluffing about indexing its index

STEPS TO REPRODUCE:

    In a test username, one without many things to index, configure
    baloo to index hidden files

        balooctl config set hidden true

    and run

        balooctl monitor

    in a second window. Purge the index

        balooctl purge

    and watch...

OBSERVED RESULTS

    You'll see "balooctl monitor" show

        Indexing modified files
        Indexing file content
        Indexing: /home/test/.local/share/baloo/index: Ok

    and also 'at regular intervals' 

        Indexing modified files
        Indexing file content
        Indexing: /home/test/.local/share/baloo/index-lock: Ok

EXPECTED RESULTS

    Gut feeling is that baloo should avoid its index 

SYSTEM INFORMATION

    Neon Testing
    Plasma : 5.21.3
    Frameworks : 5.81.0
    Qt : 5.15.2 

ADDITIONAL INFORMATION

    Probably just noise :-)

    Don't see any evidence of a change to the index file when it is "indexed",
    I'm assuming the attempt is caught somewhere else in the process. Also
    not noticed any performance blips to say that baloo is read the full
    index file. Not clear if the file is read to determine the mimetype
    and (just maybe) there's a worry is that a 'read' of the index impacts
    the file locking.

    The lockfile is however reindexed at intervals (maybe every 45 to 50
    seconds). That is, baloo notices that its index has been locked/released
    and indexes at the lockfile again, which locks/releases the index.

    Reported on the offchance that a nastier edge case is possible.
Comment 1 Stefan Brüns 2021-03-28 16:48:02 UTC
You told it to index it, so it does.

Anyway, its harmless. It sees there is nothing to index, and continues with the next file.
Comment 2 tagwerk19 2021-03-28 21:39:46 UTC
I've no evidence that "it happens", but just to confirm that baloo isn't reading the index file? In the cases where "index" is a Gbyte or more, it could be something of a burden...

I'm happy to add a .local/share/baloo exclusion but I feel it shouldn't be necessary.
Comment 3 tagwerk19 2021-09-10 05:45:50 UTC
LMDB files are not included in the shared-mime-info database, reported:
    https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/168