Bug 435434 - Baloo occasionally skips indexing a file; balooshow shows information for a different file
Summary: Baloo occasionally skips indexing a file; balooshow shows information for a d...
Status: REPORTED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: Baloo File Daemon (show other bugs)
Version: 5.80.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Brüns
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-06 20:30 UTC by tagwerk19
Modified: 2021-05-19 06:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tagwerk19 2021-04-06 20:30:01 UTC
SUMMARY

    Baloo occasionally skips indexing a file and balooshow shows information
    for a different file

STEPS TO REPRODUCE:

    Not found a way of reliably reproducing this. This is just an
    example instance

        cd ~/Documents
        mkdir temp
        echo "Hello Penguin" > temp/file1.txt
        balooshow -x temp/file1.txt 

    gave ... 

OBSERVED RESULTS

    ... the details of something else completely (a different file, indexed
    at a different time. (Had to trim the list of terms as the full list
    looked too much like spam).

        144da00000fc01 64513 1330592 temp/file1.txt [/home/test/.kde/share/config/kdeglobals]
                Mtime: 1617136526 2021-03-30T22:35:26
                Ctime: 1617136526 2021-03-30T22:35:26
                Cached properties:
                        Line Count: 158

        Internal Info
        Terms: 0 0.025 ... Mplain Mtext T5 T8 X20-158 activebackground activeblend activeforeground backgroundalternate background ... widgetstyle window wm
        File Name Terms: Fkdeglobals
        XAttr Terms:
        lineCount: 158 

    A running "Balooctl monitor" did not show "file1.txt" being indexed.

    If I reboot I then get the "expected" info

        144da00000fc01 64513 1330592 temp/file1.txt [/home/test/Documents/temp/file1.txt]
                Mtime: 1617270546 2021-04-01T11:49:06
                Ctime: 1617270546 2021-04-01T11:49:06
                Cached properties:
                        Line Count: 1

         Internal Info
         Terms: Mplain Mtext T5 T8 X20-1 hello penguin
         File Name Terms: Ffile1 Ftxt
         XAttr Terms:
         lineCount: 1 

EXPECTED RESULTS

    balooshow -x gives details of the file

        144da00000fc01 64513 1330592 temp/file1.txt [/home/test/Documents/temp/file1.txt]
        ...
        Internal Info
        Terms: Mplain Mtext T5 T8 X20-1 hello penguin
        File Name Terms: Ffile1 Ftxt
        XAttr Terms:
        lineCount: 1  

SOFTWARE/OS VERSIONS

    Neon Testing

    Baloo : 5.81.0
    Plasma : 5.21.3
    Frameworks : 5.81.0
    Qt : 5.15.2

ADDITIONAL INFORMATION

    Originally posted this to Bug 435161... 

    For this instance, journalctl shows a couple of possibly related lines:

        Apr 01 12:21:38 localhost.localdomain baloo_file[1100]: 5714849124383745 "/home/test/Documents/temp/file1.txt" renaming "kdeglobals" to "file1.txt"
        Apr 01 12:21:38 localhost.localdomain baloo_file[1100]: 5643818955242497 "/home/test/.kde/share/config/kdeglobals" renaming "Trolltech.conf" to "kdeglobals" 

    I'm guessing these "renamings" are not necessarily real. If I look
    back through the logs there are some batches of these messages.
Comment 1 tagwerk19 2021-04-25 07:10:24 UTC
(In reply to tagwerk19 from comment #0)
>         Apr 01 12:21:38 localhost.localdomain baloo_file[1100]:
> 5714849124383745 "/home/test/Documents/temp/file1.txt" renaming "kdeglobals"
> to "file1.txt"
>         Apr 01 12:21:38 localhost.localdomain baloo_file[1100]:
> 5643818955242497 "/home/test/.kde/share/config/kdeglobals" renaming
> "Trolltech.conf" to "kdeglobals" 
> 
>     I'm guessing these "renamings" are not necessarily real. If I look
>     back through the logs there are some batches of these messages.
Having had a look through batches of "renaming" failures/messages, the files mentioned are newly created. I suspect deleted and rewritten, with newly created files reusing "just released" inodes...

Is baloo proof against this? 

It seemingly recovers in the above instance (albeit with a reboot)
Comment 2 tagwerk19 2021-05-19 06:26:31 UTC
(In reply to tagwerk19 from comment #0)
>    mkdir temp
>    echo "Hello Penguin" > temp/file1.txt
I wonder if there is a race condition here, that the testfile is created before the inotify watches were created for the temp directory.

Not sure how to test this ...