[Nepomuk] Bugs, Patches and Scripts. - StrigiService & KInotify

Vishesh Handa handa.vish at gmail.com
Mon Apr 26 13:33:43 CEST 2010


Hi.
*
BUG :*

I was going through the Strigi Service, and I noticed that it stores the
folders to index in a service file named strigiservicerc (duh!) The problem
is that the folder being watched are sometimes renamed/moved, and when that
happens Strigi deletes its indexed metadata. Furthermore, if a directory in
one of the indexed directories, and is moved out of it, the metadata is
deleted. :-/ This all happens when the strigiservice is restarted. The
culprit -> Nepomuk::IndexScheduler::removeOldAndUnwantedEntries()

Fixing this, in my opinion, would require us to watch the indexed
directories for changes. Unfortunately crappy *inotify* doesn't allow this.
If a watched directory is renamed it gives us a EventMoveSelf, but doesn't
tell us what it has been renamed to or where it has been moved. (I know!
Stupid!) So, the only solution I can think of is to watch its parent
directory, that will atleast tell us what it's been renamed to. In order to
know where it has been moved to we'll need to watch everything, which is a
huge resource hog (Yes, Filewatcher, I'm talking about you!)
*
PATCHES :*

For starters, we need to move the kinotify class to a better location, so
that it can be used by both the filewatcher, and strigi.

In KINotify, I found a couple of functions to be implemented inefficiently (
O(n), when it can be close to O(1). ) So, I optimized it a little bit. The
problem came while optimizing *KInotify::removeWatch( const QString& path )*.
It currently removes all watches who's paths start with path, which doesn't
seem right. It should *only* remove the watch corresponding to the given
path. The full optimization patch does this.

I've tried to hack a solution to the *BUG*. This is just a preliminary
patch! I created a new class called ConfigFolderWatcher (got a better
name?). I didn't want to clutter up the *strigiservice* class. In order for
this class to work I copied the kinotify class from the filewatch service
(Temp. solution, you'll need to do the same) The current Patch works
perfectly for renaming and moving to a sibling directory. But not for, well,
anything else. Look at the source code! The filewatcher service suffers from
a somewhat same problem.
*

SCRIPTS :*

I usually tend to write scripts for stuff I do frequently, and I wrote a
couple for Nepomuk. They are available over here ->
http://pastebin.com/pxDVSWWQ . The service ones aren't perfect but they're
useful. Has anyone else written any scripts which may be useful? If so,
please share them! :-)

Thanks

- Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100426/6bbe8b84/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple_kinotify_optim.diff
Type: text/x-patch
Size: 1507 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100426/6bbe8b84/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: full_kinotify_optim.diff
Type: text/x-patch
Size: 2259 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100426/6bbe8b84/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configFolderWatcher.diff
Type: text/x-patch
Size: 6310 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/nepomuk/attachments/20100426/6bbe8b84/attachment-0002.diff 


More information about the Nepomuk mailing list